[EMAIL PROTECTED] wrote:

> [EMAIL PROTECTED] xargs]seq 5004 5006 | awk '{print "minion"$1}' | xargs -t 
> -i ssh -q [EMAIL PROTECTED] "uname -a"
> ssh -q [EMAIL PROTECTED] uname -a
> Linux minion5004 2.6.8.1-26mdksmp #1 SMP Mon Nov 28 12:40:04 MST 2005 i686 
> Intel(R) Xeon(TM) CPU 2.80GHz unknown GNU/Linux
> ssh -q [EMAIL PROTECTED] uname -a
> xargs: ssh: exited with status 255; aborting

Can't you achieve the desired effect portably without requiring any
xargs special casing with e.g.

(stuff) | xargs -t -i sh -c 'ssh -q [EMAIL PROTECTED] "uname -a"; ret=$?; test
$ret == 255 && exit 0; exit $ret'

Or if you don't care what the exit value is, 

(stuff) | xargs -t -i sh -c 'ssh -q [EMAIL PROTECTED] "uname -a" || :'

Although I think I would argue xargs is really not the right tool for
the job here at all -- you're only using it to substitute {} for a
variable, and the shell is more than capable of doing that on its own
(not to mention the needless use of awk):

$ for H in `seq 5004 5006`; do ssh -q [EMAIL PROTECTED] "uname -a"; done

Also, it sounds like you might want to check out 'dsh'.

Brian


Reply via email to