app-shells/dash fails to correctly limit the scope of variable assignments when calling a function. Consider the following test code: #v+ func() {true; } RANDUM=a RANDUM=b func echo ${RANDUM} #v- In bash and posh, the above example output 'a'. In dash (tested 0.5.5.1.2 and 0.5.5.1.7), it outputs 'b'. As SUS states, 'If no command name results, variable assignments shall affect the current execution environment. Otherwise, the variable assignments shall be exported for the execution environment of the command and shall not affect the current execution environment (except for special built-ins)' [1]. Thus, I consider dash behaviour a bug. [1] http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_09_01
this is correct behavior. bash does the same thing when invoked as /bin/sh. it's even more obnoxious that bash changes its behavior based on how it was invoked. http://lists.gnu.org/archive/html/bug-bash/2010-08/msg00164.html
Let's reuse the bug for reverse posh bugreport then.