On Sun, 16 Mar 2014, Cristian Ionescu-Idbohrn wrote:
>
> WRT script line the error is associated to, it seems dash is doing the
> best jobb ("14: parameter not set", printed when trying to print
> IFS, immediately after unsetting it). ash reports the error on the
> line function f is called. That seems to be the only difference
> between dash and ash. bash reports 2 errors "line 11: IFS: unbound
> variable" and "line 14: IFS: unbound variable".
I just had a look att commit 109ee5d33694a03cda3424b4846584250832ba8e.
IMO, to imitate bash behaviour isn't the right thing to do. It's a bug.
Imitate dash behaviour instead.
Refer to the test shell/ash_test/ash-misc/local1.tests.
Upon entering function `f', `local a' makes a copy of the variable
with the same name in the upper scope. `local a' should not
implicitly `unset a'. Let the user decide what to do with variable
'a' (modify, unset, whatever).
What do people think?
Cheers,
--
Cristian
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox