aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-misc
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush_test/hush-misc')
-rw-r--r--shell/hush_test/hush-misc/redir1.right2
-rwxr-xr-xshell/hush_test/hush-misc/redir1.tests6
-rw-r--r--shell/hush_test/hush-misc/redir4.right25
-rwxr-xr-xshell/hush_test/hush-misc/redir4.tests80
4 files changed, 113 insertions, 0 deletions
diff --git a/shell/hush_test/hush-misc/redir1.right b/shell/hush_test/hush-misc/redir1.right
index ac90b4a0a..15515d1af 100644
--- a/shell/hush_test/hush-misc/redir1.right
+++ b/shell/hush_test/hush-misc/redir1.right
@@ -1,3 +1,5 @@
+Test 0: var:ok
+File created:ok
Test 1: var:ok
File created:ok
Test 2: var:ok
diff --git a/shell/hush_test/hush-misc/redir1.tests b/shell/hush_test/hush-misc/redir1.tests
index 7e204514c..70e9e17f0 100755
--- a/shell/hush_test/hush-misc/redir1.tests
+++ b/shell/hush_test/hush-misc/redir1.tests
@@ -1,5 +1,11 @@
rm shell_test_$$ 2>/dev/null
var=bad
+>shell_test_$$ var=ok
+echo "Test 0: var:$var"
+test -f shell_test_$$ && echo "File created:ok"
+
+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"
diff --git a/shell/hush_test/hush-misc/redir4.right b/shell/hush_test/hush-misc/redir4.right
new file mode 100644
index 000000000..ada6c2d85
--- /dev/null
+++ b/shell/hush_test/hush-misc/redir4.right
@@ -0,0 +1,25 @@
+shell_test
+\shell_test
+\shell_test
+\shell_test
+Here1
+Ok1
+Here2
+Ok2
+Here3
+Ok3
+Here4
+Ok4
+How with variable refs
+shell_test_1
+\shell_test_1
+\shell_test_1
+\shell_test_1
+Here1
+Ok1
+Here2
+Ok2
+Here3
+Ok3
+Here4
+Ok4
diff --git a/shell/hush_test/hush-misc/redir4.tests b/shell/hush_test/hush-misc/redir4.tests
new file mode 100755
index 000000000..ac2a44166
--- /dev/null
+++ b/shell/hush_test/hush-misc/redir4.tests
@@ -0,0 +1,80 @@
+rm *shell_test* 2>/dev/null
+
+>\shell_test
+echo *shell_test*
+rm *shell_test*
+
+>\\shell_test
+echo *shell_test*
+rm *shell_test*
+
+>"\shell_test"
+echo *shell_test*
+rm *shell_test*
+
+>"\\shell_test"
+echo *shell_test*
+rm *shell_test*
+
+
+cat <<\shell_test
+Here1
+shell_test
+echo Ok1
+
+cat <<\\shell_test
+Here2
+\shell_test
+echo Ok2
+
+cat <<"\shell_test"
+Here3
+\shell_test
+echo Ok3
+
+cat <<"\\shell_test"
+Here4
+\shell_test
+echo Ok4
+
+
+echo How with variable refs
+i=1
+
+
+>\shell_test_$i
+echo *shell_test*
+rm *shell_test*
+
+>\\shell_test_$i
+echo *shell_test*
+rm *shell_test*
+
+>"\shell_test_$i"
+echo *shell_test*
+rm *shell_test*
+
+>"\\shell_test_$i"
+echo *shell_test*
+rm *shell_test*
+
+
+cat <<\shell_test_$i
+Here1
+shell_test_$i
+echo Ok1
+
+cat <<\\shell_test_$i
+Here2
+\shell_test_$i
+echo Ok2
+
+cat <<"\shell_test_$i"
+Here3
+\shell_test_$i
+echo Ok3
+
+cat <<"\\shell_test_$i"
+Here4
+\shell_test_$i
+echo Ok4