Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Mar 2000 13:45:44 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Doug Barton <Doug@gorean.org>
Cc:        hackers@FreeBSD.org, Max Khon <fjoe@iclub.nsu.ru>, Sheldon Hearn <sheldonh@uunet.co.za>
Subject:   Re: empty lists in for
Message-ID:  <200003061845.NAA02386@server.baldwin.cx>
In-Reply-To: <38C3737B.63ACC551@gorean.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 06-Mar-00 Doug Barton wrote:
> I just checked POSIX 1003.2.
> 
> for name [ in word ] 
> do
>         compound-list
> done
> 
> the "in word" is optional. Therefore:
> 
> for name in ; do echo $name; done
> 
> is an error, whereas
> 
> for name ; do echo $name; done

These are two different functions.  The second one loops through the
command line parameters.

> is not, and Bash does not report it as so, in or out of POSIX mode.
> Also, your snippet clearly expects that there will be a word after "in."
> It could easily be argued from that context that the presence of "in"
> without a "word" to go with it is an error, even without the bit from
> Martin's post. 
> 
>       All that said, if the ports make system depends on the current
> behavior, it has to be fixed before we can contemplate any changes.

Patches accepted.

> Doug

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003061845.NAA02386>