On Friday 09 October 2009, Pierre Gaston wrote:

> > Well, it seems to me (and as stated in the bug report) that a "do" should
> > follow the "while read NAME;".
>
> the while syntax is like this:
> "while list; do list; done"
> and the manual says "A sequence of one or more newlines may appear in a
> list  instead  of  a semicolon to delimit commands."
> so you can have:
>
> while command
> command
> do
>
> (the ; in the definition is probably there to keep the definition on one
> line, you can replace the ; in all the other definitions by a newline like:
> if command
> then
>
> This also works the same way in the other shells. For me it's not a bug.

Uhm, on a more accurate reading you're probably right. The POSIX syntax for 
while is

while compound-list-1 do
    compound-list-2
done

And "read NAME; echo NAME=$NAME" is a compound-list. So I was deceived by the 
formatting, I think you are right. Thanks for correcting me.

-- 
D.


Reply via email to