xref: /freebsd/bin/sh/tests/expansion/length4.0 (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1
2# The construct ${#?} is ambiguous in POSIX.1-2008: it could be the length
3# of $? or it could be $# giving an error in the (impossible) case that it
4# is not set.
5# We use the former interpretation; it seems more useful.
6
7:
8[ "${#?}" = 1 ] || echo '${#?} wrong'
9(exit 42)
10[ "${#?}" = 2 ] || echo '${#?} wrong'
11