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