On Wed, Feb 1, 2012 at 3:46 PM, Alexander Dalloz ad+lists@uni-x.org wrote:
That has simply nothing to do with SSH. Compare following:
echo "foo bar" | while read LINE; do echo $LINE; done
and
echo -e "foo\nbar" | while read $LINE; do echo $LINE; done
No, (a) that read $LINE should be read LINE and (b) echo "foo bar" | something should preserve the quoted newline. Ssh does seem to be consuming stuff from the inherited piped stdin even though it isn't obvious what it does with it in a non-interactive scenario. But anything that reads stdin inside the loop would cause that (throw a 'cat >dev/null' in...).