16 Dec
2011
16 Dec
'11
2:42 p.m.
On Thu, Dec 15, 2011 at 8:04 PM, Ralph Mitchell <ralphmitchell at gmail.com> wrote:
I think ssh is "draining" the input stream, which in this case means the pipeline coming into the while loop. Try redirecting the ssh input stream from /dev/null:
/usr/bin/ssh bwadmin@${MACHINE} "hostname" < /dev/null
I tested that with this command line:
ls | while read a; do ssh 192.168.1.4 hostname < /dev/null ; done
and got back the remote host name once for each file in the local directory.
Yes - that fixed everything. Thank you so much for the replying.