freebsd-dev/tools/regression/bin/sh/expansion/set-u2.0
Jilles Tjoelker 64254a667a 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).
2009-10-24 21:20:04 +00:00

13 lines
133 B
Plaintext

# $FreeBSD$
set -u
: $* $@ "$@" "$*"
set -- x
: $* $@ "$@" "$*"
shift $#
: $* $@ "$@" "$*"
set -- y
set --
: $* $@ "$@" "$*"
exit 0