diff options
author | jilles <jilles@FreeBSD.org> | 2011-05-04 22:12:22 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2011-05-04 22:12:22 +0000 |
commit | ba0d29571f9f8f83653cd0298a96664fe82e0e04 (patch) | |
tree | b5d34d5bbcadf2e334bbcb6aceab0acd2258ee47 /tools | |
parent | 48e83eacf3f56abcf0a13583eb07ea21151165b3 (diff) | |
download | FreeBSD-src-ba0d29571f9f8f83653cd0298a96664fe82e0e04.zip FreeBSD-src-ba0d29571f9f8f83653cd0298a96664fe82e0e04.tar.gz |
sh: Apply set -u to variables in arithmetic.
Note that this only applies to variables that are actually used.
Things like (0 && unsetvar) do not cause an error.
Exp-run done by: pav (with some other sh(1) changes)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/bin/sh/expansion/set-u3.0 | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/expansion/set-u3.0 b/tools/regression/bin/sh/expansion/set-u3.0 new file mode 100644 index 0000000..7f199b4 --- /dev/null +++ b/tools/regression/bin/sh/expansion/set-u3.0 @@ -0,0 +1,6 @@ +# $FreeBSD$ + +set -u +unset x +v=$( (eval ': $((x))') 2>&1 >/dev/null) +[ $? -ne 0 ] && [ -n "$v" ] |