2010-05-18 12:35:20 +00:00
|
|
|
# true is a regular builtin, varibale should not leak out of it
|
|
|
|
# this currently fails with CONFIG_FEATURE_SH_NOFORK=y
|
2008-04-13 17:45:56 +00:00
|
|
|
VAR=''
|
2010-05-18 12:35:20 +00:00
|
|
|
VAR=val1 true
|
2008-04-13 17:45:56 +00:00
|
|
|
echo "should be empty: '$VAR'"
|
|
|
|
|
2010-05-18 12:35:20 +00:00
|
|
|
# ash follows the "special builtin leaks variables" rule here:
|
|
|
|
# exec is a special builtin. (bash does not do it)
|
2008-04-13 17:45:56 +00:00
|
|
|
VAR=''
|
2010-05-18 12:35:20 +00:00
|
|
|
VAR=val2 exec 2>&1
|
|
|
|
echo "should be not empty: '$VAR'"
|
|
|
|
|
|
|
|
# ash follows the "function call is a special builtin" rule here
|
|
|
|
# (bash does not do it)
|
|
|
|
f() { true; }
|
|
|
|
VAR=''
|
|
|
|
VAR=val3 f
|
|
|
|
echo "should be not empty: '$VAR'"
|