Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!ccncsu!handel.CS.ColoState.Edu!hallt From: hallt@handel.CS.ColoState.Edu (Tim C. Hall) Newsgroups: comp.unix.questions Subject: Why doesn't this work? Summary: strange xargs behavior Keywords: xargs, HELP Message-ID: <15679@ccncsu.ColoState.EDU> Date: 24 Jun 91 22:52:23 GMT Sender: news@ccncsu.ColoState.EDU Reply-To: hallt@handel.UUCP (Tim C. Hall) Organization: Colorado State University, Fort Collins, CO 80523 Lines: 21 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@handel.cs.colostate.edu