aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-redir/redir4.tests
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-10-02 18:32:52 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-10-02 18:32:52 +0200
commitdf303ae11731b07f63b7034a7c141931d7a6fcbb (patch)
tree39daf30ce526ee9d9cfb1ebe8326bd13588d8942 /shell/hush_test/hush-redir/redir4.tests
parentc7a774dde4b777126de5ef9f718b503a15bf4d30 (diff)
downloadbusybox-df303ae11731b07f63b7034a7c141931d7a6fcbb.tar.gz
sh testsuite: sync ash-redir/ and hush-redir/
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test/hush-redir/redir4.tests')
-rwxr-xr-xshell/hush_test/hush-redir/redir4.tests157
1 files changed, 72 insertions, 85 deletions
diff --git a/shell/hush_test/hush-redir/redir4.tests b/shell/hush_test/hush-redir/redir4.tests
index c50b8cedf..4bdf5ae27 100755
--- a/shell/hush_test/hush-redir/redir4.tests
+++ b/shell/hush_test/hush-redir/redir4.tests
@@ -1,85 +1,72 @@
-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 Now 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*
-
-echo Done;exit
-# UNFIXED BUG. bash apparently will expand $i even in terminating delimiter.
-# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
-# does not mandate this behavior.
-# This is not likely to be used much in real-world.
-
-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
+# ash uses fd 10 (usually) for reading the script
+exec 13>&-
+exec 12>&-
+exec 11>&-
+exec 10>&-
+# some amount of input is prefetched.
+# make sure final echo is far enough to not be prefetched.
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+###############################################################
+echo "OK"