summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-05-21 14:52:26 +0000
committerjilles <jilles@FreeBSD.org>2011-05-21 14:52:26 +0000
commitd865e9ee8fe0e2c9485df849fc5c963bf0332d4d (patch)
tree4c24d414b516353f2db890d4db4b4891d3cac958 /tools
parent1f45be52d9218b291a79dad8bc60e4fa227c2af2 (diff)
downloadFreeBSD-src-d865e9ee8fe0e2c9485df849fc5c963bf0332d4d.zip
FreeBSD-src-d865e9ee8fe0e2c9485df849fc5c963bf0332d4d.tar.gz
sh: Add test for positional parameters with more than one digit.
This also passes on stable/8.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/bin/sh/parameters/positional1.013
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/parameters/positional1.0 b/tools/regression/bin/sh/parameters/positional1.0
new file mode 100644
index 0000000..67d1951
--- /dev/null
+++ b/tools/regression/bin/sh/parameters/positional1.0
@@ -0,0 +1,13 @@
+# $FreeBSD$
+
+set -- a b c d e f g h i j
+[ "$1" = a ] || echo "error at line $LINENO"
+[ "${1}" = a ] || echo "error at line $LINENO"
+[ "${1-foo}" = a ] || echo "error at line $LINENO"
+[ "${1+foo}" = foo ] || echo "error at line $LINENO"
+[ "$1+foo" = a+foo ] || echo "error at line $LINENO"
+[ "$10" = a0 ] || echo "error at line $LINENO"
+[ "$100" = a00 ] || echo "error at line $LINENO"
+[ "${10}" = j ] || echo "error at line $LINENO"
+[ "${10-foo}" = j ] || echo "error at line $LINENO"
+[ "${100-foo}" = foo ] || echo "error at line $LINENO"
OpenPOWER on IntegriCloud