xref: /freebsd/bin/sh/tests/parameters/positional9.0 (revision 8aac90f18aef7c9eea906c3ff9a001ca7b94f375)
1# Although POSIX leaves the result of expanding ${#@} and ${#*} unspecified,
2# make sure it is at least numeric.
3
4set -- bb cc ddd
5set -f
6lengths=${#*}${#@}"${#*}${#@}"$(echo ${#*}${#@}"${#*}${#@}")
7IFS=
8lengths=$lengths${#*}${#@}"${#*}${#@}"$(echo ${#*}${#@}"${#*}${#@}")
9case $lengths in
10*[!0-9]*)
11	printf 'bad: %s\n' "$lengths"
12	exit 3 ;;
13????????????????*) ;;
14*)
15	printf 'too short: %s\n' "$lengths"
16	exit 3 ;;
17esac
18