busybox/shell/hush_test/hush-misc/redir1.tests
2009-04-06 12:34:27 +00:00

35 lines
832 B
Plaintext
Executable File

rm shell_test_$$ 2>/dev/null
var=bad
var=ok >shell_test_$$
echo "Test 1: var:$var"
test -f shell_test_$$ && echo "File created:ok"
rm shell_test_$$ 2>/dev/null
var=ok
true | var=bad >shell_test_$$
echo "Test 2: var:$var"
test -f shell_test_$$ && echo "File created:ok"
rm shell_test_$$ 2>/dev/null
var=bad
{ var=ok >shell_test_$$; }
echo "Test 3: var:$var"
test -f shell_test_$$ && echo "File created:ok"
rm shell_test_$$ 2>/dev/null
var=ok
{ var=bad >shell_test_$$; } &
# cant use usleep as it isnt standard in $PATH --
# we fail when testing busybox compiled solely as "hush"
sleep 1
echo "Test 4: var:$var"
test -f shell_test_$$ && echo "File created:ok"
rm shell_test_$$ 2>/dev/null
var=ok
( var=bad >shell_test_$$ )
echo "Test 5: var:$var"
test -f shell_test_$$ && echo "File created:ok"
rm shell_test_$$ 2>/dev/null