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 ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature