summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-06-05 14:13:15 +0000
committerjilles <jilles@FreeBSD.org>2011-06-05 14:13:15 +0000
commitfba76e8544240faef25943d9886fc3bc31161eb9 (patch)
treedec8a05e107755532c22074f8da51760f2c5ab63 /tools
parentc8f0bef5361aefeba950c1f660d51e9a146e0094 (diff)
downloadFreeBSD-src-fba76e8544240faef25943d9886fc3bc31161eb9.zip
FreeBSD-src-fba76e8544240faef25943d9886fc3bc31161eb9.tar.gz
sh: Fix $? in heredocs on simple commands.
PR: bin/41410
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/bin/sh/expansion/heredoc2.015
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/expansion/heredoc2.0 b/tools/regression/bin/sh/expansion/heredoc2.0
new file mode 100644
index 0000000..2551432
--- /dev/null
+++ b/tools/regression/bin/sh/expansion/heredoc2.0
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+f() { return $1; }
+
+[ `f 42; cat <<EOF
+$?
+EOF
+` = 42 ] || echo simple command bad
+
+long=`printf %08192d 0`
+
+[ `f 42; cat <<EOF
+$long.$?
+EOF
+` = $long.42 ] || echo long simple command bad
OpenPOWER on IntegriCloud