Andreas Schwab wrote:
> Jim Meyering <j...@meyering.net> writes:
>
>> IMHO, the fact that VAR=$OTHER_VAL never needs quotes
>> should imply that `local VAR=$OTHER_VAL' also requires no quotes.
>
> I wonder where POSIX requires or even allows that export VAR=$foo does
> not perform word splitting (although the second export example would be
> unsafe with word splitting).

The export built-in of FreeBSD 8.1's /bin/sh does not work as I would
expect (but I haven't read the spec recently):

    freebsd$ /bin/sh -c 'v="a b"; export s=$v; echo $s'
    a

I was surprised to see that dash-0.5.6-2.fc14.x86_64 agrees:

    dash -c 'v="a b"; export s=$v; echo $s'
    a

I expected what bash and zsh print:

    a b

This makes me think perhaps I should not exclude FreeBSD's /bin/sh.

Reply via email to