From 4aca87515a5083ae0e31ce3177189fd43b6d05ac Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 3 Jan 2015 13:58:15 +0100 Subject: patch to Vanilla Tomato 1.28 --- .../shell/ash_test/ash-heredoc/heredoc.tests | 94 ++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100755 release/src/router/busybox/shell/ash_test/ash-heredoc/heredoc.tests (limited to 'release/src/router/busybox/shell/ash_test/ash-heredoc/heredoc.tests') diff --git a/release/src/router/busybox/shell/ash_test/ash-heredoc/heredoc.tests b/release/src/router/busybox/shell/ash_test/ash-heredoc/heredoc.tests new file mode 100755 index 00000000..b3cdc3f7 --- /dev/null +++ b/release/src/router/busybox/shell/ash_test/ash-heredoc/heredoc.tests @@ -0,0 +1,94 @@ +# check order and content of multiple here docs + +cat << EOF1 << EOF2 +hi +EOF1 +there +EOF2 + +while read line1; do + read line2 <&3 + echo $line1 - $line2 +done < /tmp/bash-zzz << EOF +abc +EOF +cat >> /tmp/bash-zzz << EOF +def ghi +jkl mno +EOF +cat /tmp/bash-zzz +rm -f /tmp/bash-zzz + +# make sure command printing puts the here-document as the last redirection +# on the line, and the function export code preserves syntactic correctness +fff() +{ + ed /tmp/foo </dev/null +/^name/d +w +q +ENDOFINPUT +aa=1 +} + +type fff +#ash# export -f fff +#ash# ${THIS_SH} -c 'type fff' + +# check that end of file delimits a here-document +# THIS MUST BE LAST! + +cat << EOF +hi +there -- cgit v1.2.3-54-g00ecf