summaryrefslogtreecommitdiff
path: root/shell/ash_test/ash-vars/var_leak.tests
blob: 032059295e2eb7e3186a9461b911f485c40f128d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# true is a regular builtin, varibale should not leak out of it
# this currently fails with CONFIG_FEATURE_SH_NOFORK=y
VAR=''
VAR=val1 true
echo "should be empty: '$VAR'"

# ash follows the "special builtin leaks variables" rule here:
# exec is a special builtin. (bash does not do it)
VAR=''
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'"