why is this for loop not entered?
hello linux q
I just wrote this script to shutdown my list of xen machines, back them up via rsync, then restart them. And can't for the life of me figure out why it never enters into the first (and likely other) for loop(s) Code:
|
The first question will have to be what the output of
Code:
/usr/bin/virsh list | /bin/grep -v -e Id -e --- -e 0 | /bin/awk '{print $1}' Cheers, Tink |
that did it!!!
ah! the output was nothing, tho I honestly thought I saw some output from the same line before.
this line did the trick!! Code:
/usr/bin/virsh list | /bin/grep -v -e Id -e --- -e 'Domain-0' | /bin/awk '{print $1}' thanks and best wishes!! |
Heh ... anytime ;}
Cheers, Tink |
Personally I would ask why the use of grep at all seeing awk would do all the work you have written.
Also a preference is to use $() at least when showing code here as very difficult for some of us oldies to pick up where the backticks start and stop :( |
All times are GMT -5. The time now is 12:42 AM. |