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: tutimura
Subject: Re: 'for f in' with empty list occers error
Date: Thu, 30 May 2002 13:33:22 +0900

From: address@hidden (Paul Jarc)
Subject: Re: 'for f in' with empty list occers error
Date: Mon, 27 May 2002 15:57:21 -0400
Message-ID: <address@hidden>

prj> Nobuyuki Tsuchimura <address@hidden> wrote:
prj> >> $ for f in ; do echo '$f='$f; done
prj> >> bash: syntax error near unexpected token `;'
prj> >
prj> >   According to man, this should do nothing, I think.
prj> >
prj> >> If the expansion of the items following in results in an empty list,
prj> >> no commands are executed, and the return status is 0.
prj> 
prj> There's a difference between items that expand to an empty list, and
prj> no items at all.  The man page is talking about code like this:
prj> for f in $list ; do ... ; done
prj> where $list may be empty.

  Oh, I got a nice work around.

$ for f in $dummy; do ...; done

'$dummy' keeps an error away.
Thank you very much for your good hint.
-- Nobuyuki Tsuchimura



reply via email to

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