]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/parameters/positional9.0
shell_cmds-216.60.1.tar.gz
[apple/shell_cmds.git] / sh / tests / parameters / positional9.0
1 # $FreeBSD: head/bin/sh/tests/parameters/positional9.0 291903 2015-12-06 14:09:31Z jilles $
2 # Although POSIX leaves the result of expanding ${#@} and ${#*} unspecified,
3 # make sure it is at least numeric.
4
5 set -- bb cc ddd
6 set -f
7 lengths=${#*}${#@}"${#*}${#@}"$(echo ${#*}${#@}"${#*}${#@}")
8 IFS=
9 lengths=$lengths${#*}${#@}"${#*}${#@}"$(echo ${#*}${#@}"${#*}${#@}")
10 case $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 ;;
18 esac