aboutsummaryrefslogtreecommitdiff
path: root/tests/sh.testcases
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sh.testcases')
-rw-r--r--tests/sh.testcases33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/sh.testcases b/tests/sh.testcases
new file mode 100644
index 000000000..85d72a200
--- /dev/null
+++ b/tests/sh.testcases
@@ -0,0 +1,33 @@
1# try running this with bash, ksh, ash, and hush.
2echo `echo -e foo\\\necho bar`
3
4echo THIS IS A TEST >foo
5cat $(echo FOO | tr 'A-Z' 'a-z')
6cat foo | tr 'A-Z' 'a-z'
7cat $(echo FOO | tr 'A-Z' 'a-z') | tr 'A-Z' 'a-z'
8
9cat foo | if true; then tr 'A-Z' 'a-z'; else echo bar1; fi
10cat foo | if false; then tr 'A-Z' 'a-z'; else echo bar2; fi
11if true; then tr 'A-Z' 'a-z'; else echo bar3; fi <foo
12if false; then tr 'A-Z' 'a-z'; else echo bar4; fi <foo
13if true || false; then echo foo; else echo bar5; fi
14if 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.
18unset TMP
19rm -f fish
20TMP=fish >$TMP
21ls fish
22
23# The following example shows that hush's parser is
24# not _really_ Bourne compatible
25echo "echo Hello World" >"a=b"
26unset a
27chmod a+x "a=b"
28PATH=$PATH:.
29"a=b"
30echo $a
31
32# assuming the shell wasn't too buggy, clean up the mess
33rm -f a=b fish foo