Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Short loops?



Peter Stephenson wrote:
>     while (( i++ < 10 )); { echo i is $i; }   # Wrong!

I would add that

while (( i++ < 10 ))
{
        echo i is $i
}

is also wrong, since newline behaves line a semicolon.  And I would not
encourage the usage of this brace syntax in scrips because these syntax
rules are quite complicated.  The old sh syntax do not have these hidden
traps.  A lengthy discussion of this syntax in the FAQ may seem to
encourage the usage.

Zoltan



Messages sorted by: Reverse Date, Date, Thread, Author