Denis Vlasenko | 552433b | 2009-04-04 19:29:21 +0000 | [diff] [blame] | 1 | rm shell_test_$$ 2>/dev/null |
| 2 | var=bad |
| 3 | var=ok >shell_test_$$ |
| 4 | echo "Test 1: var:$var" |
| 5 | test -f shell_test_$$ && echo "File created:ok" |
| 6 | |
| 7 | rm shell_test_$$ 2>/dev/null |
| 8 | var=ok |
| 9 | true | var=bad >shell_test_$$ |
| 10 | echo "Test 2: var:$var" |
| 11 | test -f shell_test_$$ && echo "File created:ok" |
| 12 | |
| 13 | rm shell_test_$$ 2>/dev/null |
| 14 | var=bad |
| 15 | { var=ok >shell_test_$$; } |
| 16 | echo "Test 3: var:$var" |
| 17 | test -f shell_test_$$ && echo "File created:ok" |
| 18 | |
| 19 | rm shell_test_$$ 2>/dev/null |
| 20 | var=ok |
| 21 | { var=bad >shell_test_$$; } & |
| 22 | usleep 100000 |
| 23 | echo "Test 4: var:$var" |
| 24 | test -f shell_test_$$ && echo "File created:ok" |
| 25 | |
| 26 | rm shell_test_$$ 2>/dev/null |
| 27 | var=ok |
| 28 | ( var=bad >shell_test_$$ ) |
| 29 | echo "Test 5: var:$var" |
| 30 | test -f shell_test_$$ && echo "File created:ok" |
| 31 | |
| 32 | rm shell_test_$$ 2>/dev/null |