Why doesn't this work?

Tim C. Hall hallt at handel.CS.ColoState.Edu
Tue Jun 25 08:52:23 AEST 1991


Hi all,
   I want to write a single command that will perform some action on
every host that shows as "up" in the output of ruptime.  So far I have:

ruptime | grep up | awk '{ print $1 }' | xargs -i -t remsh {} cat /log

Using the -t option of xargs, it echoes the first command formed by 
the first "up" host listed in the ruptime, then runs that command.  
However, it drops me back into the shell after executing with only
the first host, it doesn't substitute the remainder of the hosts
coming through the pipe.  Why?  Running this command without the
xargs portion yields a list of all our "up" hosts, delimited by a
carriage return.  What am I missing here?  Please email all responses,
I'll post a summary to the net if there is sufficient interest.  Oh yeah,
we're running System V 3.2.2 on an ATT 3B2/600.

Thanks in advance.

Tim C. Hall
hallt at handel.cs.colostate.edu



More information about the Comp.unix.questions mailing list