logo       

Re: [in WORDS ... ;] === should be ===> [in WORDS ... ];: msg#00205

shells.bash.bugs

Subject: Re: [in WORDS ... ;] === should be ===> [in WORDS ... ];

Abraham Alawi <aalawi@xxxxxxxxx> wrote:
> [in WORDS ... ;] === should be ===> [in WORDS ... ];
>
> as the semicolon in this case is compulsary not optional to be
> included between the brackets.

Actually, it is optional when "in WORDS" is absent (at least for bash,
although portable scripts shouldn't rely on it):
$ set 1 2; for i do echo "$i"; done; for i; do echo "$i";done
1
2
1
2

So it should really be: for NAME [[in WORDS ...] ;] do COMMANDS; done


paul


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise