This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [committed] remove 'for x in .. ${foo}' idiom from configure.in
- From: neroden at twcny dot rr dot com (Nathanael Nerode)
- To: geoffk at geoffk dot org, gcc-patches at gcc dot gnu dot org
- Date: Sun, 31 Aug 2003 17:12:45 -0400
- Subject: Re: [committed] remove 'for x in .. ${foo}' idiom from configure.in
>neroden@twcny.rr.com (Nathanael Nerode) writes:
>
>> This idiom is for Makefiles. The shell quite happily handles
>> for x in ${foo}
>> where ${foo} evaluates to nothing. (It does nothing in this case.)
>
Geoff Keating wrote:
>At least some versions of bash (I think the early bash 2.x versions)
>reject this construct.
You are mistaken.
Maybe I didn't make myself clear.
The shell quite happily handles
for x in ${foo} ; do ...
where ${foo} evaluates to nothing. (It does nothing in this case.)
In a Makefile, ${foo} is evaluated by 'make', and the shell sees:
for x in ; do ...
which is illegal in many shells including early bash 2.0 versions.
But if you're *not* in a Makefile, you don't need to use this idiom (and
shouldn't).
--
Nathanael Nerode <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html