bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'for f in' with empty list occers error


From: Paul Jarc
Subject: Re: 'for f in' with empty list occers error
Date: Mon, 27 May 2002 15:57:21 -0400
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i686-pc-linux-gnu)

Nobuyuki Tsuchimura <address@hidden> wrote:
>> $ for f in ; do echo '$f='$f; done
>> bash: syntax error near unexpected token `;'
>
>   According to man, this should do nothing, I think.
>
>> If the expansion of the items following in results in an empty list,
>> no commands are executed, and the return status is 0.

There's a difference between items that expand to an empty list, and
no items at all.  The man page is talking about code like this:
for f in $list ; do ... ; done
where $list may be empty.  However, the lastest version of bash,
2.05a, also accepts the "for f in ;" syntax.


paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]