summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2009-10-24 21:20:04 +0000
committerjilles <jilles@FreeBSD.org>2009-10-24 21:20:04 +0000
commitae4c008ec3d9b67e1adc09d619f972b0838e282b (patch)
tree630a88562311f15ec50712a00b864472ebea5f86 /tools
parent78d7070a590cfdd525d736fd6bd44f7939cb200b (diff)
downloadFreeBSD-src-ae4c008ec3d9b67e1adc09d619f972b0838e282b.zip
FreeBSD-src-ae4c008ec3d9b67e1adc09d619f972b0838e282b.tar.gz
sh: Exempt $@ and $* from set -u
This seems more useful and will likely be in the next POSIX standard. Also document more precisely in the man page what set -u does (note that $@, $* and $! are the only special parameters that can ever be unset, all the others are always set, although they may be empty).
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/bin/sh/expansion/set-u2.012
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/expansion/set-u2.0 b/tools/regression/bin/sh/expansion/set-u2.0
new file mode 100644
index 0000000..f81aa62
--- /dev/null
+++ b/tools/regression/bin/sh/expansion/set-u2.0
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+set -u
+: $* $@ "$@" "$*"
+set -- x
+: $* $@ "$@" "$*"
+shift $#
+: $* $@ "$@" "$*"
+set -- y
+set --
+: $* $@ "$@" "$*"
+exit 0
OpenPOWER on IntegriCloud