Comment 7 for bug 139097

Revision history for this message
Ian! D. Allen (idallen) wrote : Re: dash 0.5.3-5ubuntu2 variable expansion error using local

<pre>
@jilles - I see now that DASH and BASH differ on all assignments preceded
by keywords "local", "export", and "readonly". Both the DASH behaviour
and the BASH behaviour cannot be correct. I think you're trying to
tell me that DASH is working correctly and BASH is broken? I find the
behaviour of BASH more useful and more intuitive, given that it mimics
the non-splitting behaviour of simple variable=$var variable assignments.

So I expand my original bug report to say that all three of the keyword
cases below are broken:

$ x='1 2 3'
$ y=$x # this is how it should work for all three cases below

$ local y=$x
local: 2: 2: bad variable name # should be fixed

$ readonly y=$x
readonly: 3: 2: bad variable name # should be fixed

$ export y=$x
export: 4: 2: bad variable name # should be fixed

My assertion is still that the above DASH behaviour is broken, for all
three uses "local", "export", and "readonly". BASH is correct, and DASH
should be fixed.