Unexpected result in while do done loop reading file
I have this while do done loop in a bash shell script:
while read line;
ssh root@anotherserver "hostname"
It reads the first line of /tmp/get_mbx_stats.tmp OK, and I get the correct results from the ssh and the echo commands, but then it drops out of the loop, even though there are many more lines in /tmp/get_mbx_stats.tmp.
If I comment out the ssh command, it works as expected - it reads and echoes all the lines in the input file.
I have tried many variations but they always fail with the same issue.
(Actually I need to get information from "anotherserver" - not simply its hostname - but I boiled it down to the simplest ssh I could think of).
Is the ssh command changing the file status in some way?
Thanks in advance...
Last edited by steven.c.banks; 05-01-2008 at 10:54 AM.