This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]