[Top][All Lists]

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

Re: Document weird bug of Solaris /bin/sh w.r.t. for loops

From: Eric Blake
Subject: Re: Document weird bug of Solaris /bin/sh w.r.t. for loops
Date: Thu, 01 Jul 2010 06:53:57 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.2 Thunderbird/3.0.5

On 07/01/2010 05:42 AM, Stefano Lattarini wrote:
> Hello autoconfers.
> Is anyone aware of the following bug of Solaris /bin/sh w.r.t. for 
> loops?  I couldn't find any mention of it in the Autoconf manual, and
> I think that a proper description of the bug could be an useful 
> addition for the manual.
> $ /bin/sh -c 'for a in b=c x; do echo "$a"; done'
>  x

Freaky!  And yes, I confirmed that behavior.

No, I've never seen this bug mentioned before, and yes, mentioning it in
the manual would be worthwhile.  Thankfully, since:

> $ /bin/sh -c 'x="b=c"; for a in $x; do echo "$a"; done'
>   b=c

the bug only strikes for a word that looks like an assignment, and not
an expansion that ends up looking like an assignment, which means it
should be easy to a) grep for, and b) avoid.

Would you care to prepare a patch?

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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