help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] dumb person's looping


From: kqt4at5v
Subject: Re: [Help-bash] dumb person's looping
Date: Wed, 7 Jan 2015 08:56:46 -0600 (CST)
User-agent: Alpine 2.02 (DEB 1266 2009-07-14)

On Wed, 7 Jan 2015, Greg Wooledge wrote:

On Wed, Jan 07, 2015 at 08:28:01AM -0600, address@hidden wrote:
Would y'all explain in simple terms what is going wrong here

while read l; do echo "checking ${l}"; ssh ${l} ls; done <list_of_servers

After the first server the loop terminates

http://mywiki.wooledge.org/BashFAQ/089

Brief explanation: ssh and read are both reading from the same stdin
stream.  ssh is greedy and grabs all the data.  The wiki page shows
some workarounds.



Simple solution
Thanks



reply via email to

[Prev in Thread] Current Thread [Next in Thread]