Doug Barton <[email protected]> wrote in <[email protected]>:
do> On 02/06/2012 13:47, Hiroki Sato wrote:
do> > It actually depends on the newline
do>
do> That's way too fragile, as users are likely to put them all in one line
do> since shell syntax doesn't differentiate (assuming non-wacky values of IFS).
I don't think so. In this syntax a newline character is a separator
distinguished from normal white spaces by read statement.
do> > echo "$foo" | while read L; do echo $L; done
do>
do> Yeah, don't do that. Aside from the useless fork that you'll cause, you
do> can just as easily write:
do>
do> for L in $foo; do
do>
do> (Note that $foo is *not* quoted there ...)
No, my intention is grouping multiple words by a newline. By using
"for", lines cannot be separated from each other in the following
case:
foo="
foo foo2
bar bar2
baz
"
-- Hiroki
pgpoiFDuW85u6.pgp
Description: PGP signature
