1rm shell_test_$$ 2>/dev/null 2var=bad 3>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 9var=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_$$; } & 28# cant use usleep as it isnt standard in $PATH -- 29# we fail when testing busybox compiled solely as "hush" 30wait 31echo "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 41