Re: Bash scripting - Remotely ran commands break while loop

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



On Wed, Feb 1, 2012 at 3:46 PM, Alexander Dalloz <ad+lists@xxxxxxxxx> 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...).

-- 
   Les Mikesell
     lesmikesell@xxxxxxxxx
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux