custom xen shutdown command fails
I have a custom command I've made to quickly shut down all of my xen instances.
Code:
[root@LCENT02 ~]# virtdown What is odd to me is if I open the .env file and copy the command from there and paste it into the command line, it does actually work! Code:
[root@LCENT02 ~]# for i in `virsh list | grep -v -e Id -e --- -e Domain-0 | awk '{print $1}'`; do virsh shutdown $i; done And this is how I have the command entered into my .env file: Code:
alias virtdown="for i in `virsh list | grep -v -e Id -e --- -e Domain-0 | awk '{print $1}'`; do virsh shutdown $i; done" " Thanks in advance!! |
I am quite a Linux newbie but I have a few comments/suggestions.
You could of course just create a script file and put the command in it, that would almpost certainly solve your problem. But if you are set on using a single alias file I would hazard a guess that the quotes ("") are causing your trouble. I do not use alias much but I wonder if it accepts ('') or possibly even (``) instead of the quotes. Try this (the ('') already in the code has been changed to ("")): Code:
alias virtdown='for i in `virsh list | grep -v -e Id -e --- -e Domain-0 | awk "{print $1}"`; do virsh shutdown $i; done' |
All times are GMT -5. The time now is 02:58 PM. |