On 02/06/2012 13:47, Hiroki Sato wrote:
>  It actually depends on the newline

That's way too fragile, as users are likely to put them all in one line
since shell syntax doesn't differentiate (assuming non-wacky values of IFS).

> because the following code is used:
> 
> ---
> foo="
>       foo
>       bar
>       baz
> "
> 
> echo "$foo" | while read L; do echo $L; done

Yeah, don't do that. Aside from the useless fork that you'll cause, you
can just as easily write:

for L in $foo; do

(Note that $foo is *not* quoted there ...)


Doug

-- 

        It's always a long day; 86400 doesn't fit into a short.

        Breadth of IT experience, and depth of knowledge in the DNS.
        Yours for the right price.  :)  http://SupersetSolutions.com/


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to