xref: /freebsd/bin/sh/tests/parameters/positional9.0 (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
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