This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bash-2.x


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
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]