Numerous new testcases from Larry Doolittle and a patch to tester.sh to avoid
[oweals/busybox.git] / tests / sh.testcases
1 # try running this with bash, ksh, ash, and hush.
2 echo `echo -e foo\\\necho bar`
3
4 echo THIS IS A TEST >foo
5 cat $(echo FOO | tr 'A-Z' 'a-z')
6 cat foo | tr 'A-Z' 'a-z'
7 cat $(echo FOO | tr 'A-Z' 'a-z') | tr 'A-Z' 'a-z'
8
9 cat foo | if true;  then tr 'A-Z' 'a-z'; else echo bar1; fi
10 cat foo | if false; then tr 'A-Z' 'a-z'; else echo bar2; fi
11 if true;  then tr 'A-Z' 'a-z'; else echo bar3; fi <foo
12 if false; then tr 'A-Z' 'a-z'; else echo bar4; fi <foo
13 if true || false; then echo foo; else echo bar5; fi
14 if true && false; then echo bar6; else echo foo; fi
15
16 # ash, lash, and hush do not create fish; bash and ksh do.  Tough.
17 # Thanks to Tapani Tarvainen <tt@mit.jyu.fi> for this stress test.
18 unset TMP
19 rm -f fish
20 TMP=fish >$TMP
21 ls fish
22
23 # The following example shows that hush's parser is
24 # not _really_ Bourne compatible
25 echo "echo Hello World" >"a=b"
26 unset a
27 chmod a+x "a=b"
28 PATH=$PATH:.
29 "a=b"
30 echo $a
31
32 # assuming the shell wasn't too buggy, clean up the mess
33 rm -f a=b fish foo