bug in /bin/sh?!?

dino dino at unitix.org
Sun Apr 6 11:52:20 UTC 2008


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?

regards,

Corrado Ficicchia


More information about the freebsd-hackers mailing list