bug in /bin/sh?!?

Julian Elischer julian at elischer.org
Sun Apr 6 18:17:20 UTC 2008


dino wrote:
> Hello,
> 
> on my FreeBSD 7.0-STABLE the line:
> 
>> sh -c 'set -- ${HOME+A B C}; echo "1:$1"; echo "2:$2:"; echo "3:$3:"'
> 
> prints
> 
> 1:A B C:
> 2::
> 3::
> 
> I would rather expect:
> 
> 1:A:
> 2:B:
> 3:C:
> 
> Is it correct that field splitting isn't performed on default/alternate
> expanded values?
> 

"A B C" is a single value tha thappens to contain spaces.
so, yes there is no splitting at that point.


> regards,
> 
> Corrado Ficicchia
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"



More information about the freebsd-hackers mailing list