Subject: Re: bash-2.x
From: [email-masked] (Matthias Morche)

24 Jul 1998 09:09:20 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: Cygwin List <[email-masked]>

Jan Nieuwenhuizen wrote:
....
>        for name [ in word; ] do list ; done
>               The list of words following in is expanded,  gener-
>               ating a list of items.  The variable name is set to
>               each element of this list in turn, and list is exe-
>               cuted  each  time.   If the in word is omitted, the
>               for command executes list once for each  positional
>               parameter  that is set (see PARAMETERS below).  The
>               return status is the exit status of the  last  com-
>               mand  that executes.  If the expansion of the items
>               following in results in an empty list, no  commands
>               are executed, and the return status is 0.
> 
> Which means that empy word-list is valid, and shouldn't trigger
> an error.
> 
>     10:55:25 mub ~/ftp/gnu/bash-2.02$ for i in ;do echo $i; done
>     bash: syntax error near unexpected token `;d'
....
An empty word list is valid, but the syntax requires not to use the "in"
keyword in that case:

for i do echo $i ; done
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".