This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: bash-2.x
- To: Cygwin List <gnu-win32 at cygnus dot com>
- Subject: Re: bash-2.x
- From: Matthias Morche <Matthias dot Morche at sat1 dot de>
- Date: Fri, 24 Jul 1998 08:24:18 +0200
- Organization: (privat)
- References: <199807230858.KAA03131@digicash.com>
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".