blob: ef2fbfb77b24fe4935c49836805c2dce17556106 [file] [log] [blame]
Denis Vlasenko552433b2009-04-04 19:29:21 +00001rm shell_test_$$ 2>/dev/null
2var=bad
Denis Vlasenkoc96865f2009-04-10 00:20:58 +00003>shell_test_$$ var=ok
4echo "Test 0: var:$var"
5test -f shell_test_$$ && echo "File created:ok"
6
7rm shell_test_$$ 2>/dev/null
8var=bad
Denis Vlasenko552433b2009-04-04 19:29:21 +00009var=ok >shell_test_$$
10echo "Test 1: var:$var"
11test -f shell_test_$$ && echo "File created:ok"
12
13rm shell_test_$$ 2>/dev/null
14var=ok
15true | var=bad >shell_test_$$
16echo "Test 2: var:$var"
17test -f shell_test_$$ && echo "File created:ok"
18
19rm shell_test_$$ 2>/dev/null
20var=bad
21{ var=ok >shell_test_$$; }
22echo "Test 3: var:$var"
23test -f shell_test_$$ && echo "File created:ok"
24
25rm shell_test_$$ 2>/dev/null
26var=ok
27{ var=bad >shell_test_$$; } &
Mike Frysinger90526002009-04-06 12:34:27 +000028# cant use usleep as it isnt standard in $PATH --
29# we fail when testing busybox compiled solely as "hush"
Denis Vlasenko1fd1ea42009-04-10 12:03:20 +000030wait
Denis Vlasenko552433b2009-04-04 19:29:21 +000031echo "Test 4: var:$var"
32test -f shell_test_$$ && echo "File created:ok"
33
34rm shell_test_$$ 2>/dev/null
35var=ok
36( var=bad >shell_test_$$ )
37echo "Test 5: var:$var"
38test -f shell_test_$$ && echo "File created:ok"
39
40rm shell_test_$$ 2>/dev/null