blob: 7e204514c6cb42ac7ea3795b623b2c34c8a3566e [file] [log] [blame]
Denis Vlasenko552433b2009-04-04 19:29:21 +00001rm shell_test_$$ 2>/dev/null
2var=bad
3var=ok >shell_test_$$
4echo "Test 1: var:$var"
5test -f shell_test_$$ && echo "File created:ok"
6
7rm shell_test_$$ 2>/dev/null
8var=ok
9true | var=bad >shell_test_$$
10echo "Test 2: var:$var"
11test -f shell_test_$$ && echo "File created:ok"
12
13rm shell_test_$$ 2>/dev/null
14var=bad
15{ var=ok >shell_test_$$; }
16echo "Test 3: var:$var"
17test -f shell_test_$$ && echo "File created:ok"
18
19rm shell_test_$$ 2>/dev/null
20var=ok
21{ var=bad >shell_test_$$; } &
Mike Frysinger90526002009-04-06 12:34:27 +000022# cant use usleep as it isnt standard in $PATH --
23# we fail when testing busybox compiled solely as "hush"
24sleep 1
Denis Vlasenko552433b2009-04-04 19:29:21 +000025echo "Test 4: var:$var"
26test -f shell_test_$$ && echo "File created:ok"
27
28rm shell_test_$$ 2>/dev/null
29var=ok
30( var=bad >shell_test_$$ )
31echo "Test 5: var:$var"
32test -f shell_test_$$ && echo "File created:ok"
33
34rm shell_test_$$ 2>/dev/null