• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/busybox/shell/ash_test/ash-vars/
1# cat is an external program, variable should not leak out of it.
2# this currently fails with CONFIG_FEATURE_SH_NOFORK=y
3VAR=''
4VAR=val0 cat /dev/null
5echo "should be empty: '$VAR'"
6
7# true is a regular builtin, variable should not leak out of it.
8VAR=''
9VAR=val1 true
10echo "should be empty: '$VAR'"
11
12# ash follows the "special builtin leaks variables" rule here:
13# exec is a special builtin. (bash does not do it)
14VAR=''
15VAR=val2 exec 2>&1
16echo "should be not empty: '$VAR'"
17
18# ash follows the "function call is a special builtin" rule here
19# (bash does not do it)
20f() { true; }
21VAR=''
22VAR=val3 f
23echo "should be not empty: '$VAR'"
24