Mail Archives: cygwin/1998/07/24/09:09:20
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 AT cygnus DOT com" with one line of text: "help".
- Raw text -