[PATCH 1/3] ash: add test for issue with here document

Ron Yorston rmy at pobox.com
Thu Oct 29 11:29:59 UTC 2015


This used to work but doesn't now:

foo () {
cat <<EOF && { echo "$1" ; }
$1
EOF
}

foo "bar"

Reported-by: Natanael Copa <ncopa at alpinelinux.org>
Signed-off-by: Ron Yorston <rmy at pobox.com>
---
 shell/ash_test/ash-heredoc/heredoc2.right | 2 ++
 shell/ash_test/ash-heredoc/heredoc2.tests | 7 +++++++
 2 files changed, 9 insertions(+)
 create mode 100644 shell/ash_test/ash-heredoc/heredoc2.right
 create mode 100755 shell/ash_test/ash-heredoc/heredoc2.tests

diff --git a/shell/ash_test/ash-heredoc/heredoc2.right b/shell/ash_test/ash-heredoc/heredoc2.right
new file mode 100644
index 0000000..a486f1a
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc2.right
@@ -0,0 +1,2 @@
+bar
+bar
diff --git a/shell/ash_test/ash-heredoc/heredoc2.tests b/shell/ash_test/ash-heredoc/heredoc2.tests
new file mode 100755
index 0000000..6d9ccb6
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc2.tests
@@ -0,0 +1,7 @@
+foo () {
+cat <<EOF && { echo "$1" ; }
+$1
+EOF
+}
+
+foo "bar"
-- 
2.4.3



More information about the busybox mailing list