summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2010-12-30 15:04:59 +0000
committerjilles <jilles@FreeBSD.org>2010-12-30 15:04:59 +0000
commitfb3385d473efacdd624c80f1c69ffec96ee2cad9 (patch)
treea9083a289037c40acf3a671072ccd44160c4e836
parent64276929dedf9abcecfe35b21f4aff714a4f8c13 (diff)
downloadFreeBSD-src-fb3385d473efacdd624c80f1c69ffec96ee2cad9.zip
FreeBSD-src-fb3385d473efacdd624c80f1c69ffec96ee2cad9.tar.gz
sh: Add two tests for special cases in command substitution that already
work in stable/8.
-rw-r--r--tools/regression/bin/sh/expansion/cmdsubst8.017
-rw-r--r--tools/regression/bin/sh/expansion/cmdsubst9.011
2 files changed, 28 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/expansion/cmdsubst8.0 b/tools/regression/bin/sh/expansion/cmdsubst8.0
new file mode 100644
index 0000000..52adaea
--- /dev/null
+++ b/tools/regression/bin/sh/expansion/cmdsubst8.0
@@ -0,0 +1,17 @@
+# $FreeBSD$
+# Not required by POSIX (although referenced in a non-normative section),
+# but possibly useful.
+
+: hi there &
+p=$!
+q=$(jobs -l $p)
+
+# Change tabs to spaces.
+set -f
+set -- $q
+r="$*"
+
+case $r in
+*" $p "*) ;;
+*) echo Pid missing; exit 3 ;;
+esac
diff --git a/tools/regression/bin/sh/expansion/cmdsubst9.0 b/tools/regression/bin/sh/expansion/cmdsubst9.0
new file mode 100644
index 0000000..0b1f81f
--- /dev/null
+++ b/tools/regression/bin/sh/expansion/cmdsubst9.0
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+set -e
+
+cd /
+dummy=$(cd /bin)
+[ "$(pwd)" = / ]
+
+v=1
+dummy=$(eval v=2)
+[ "$v" = 1 ]
OpenPOWER on IntegriCloud