xref: /freebsd/bin/sh/tests/expansion/length4.0 (revision d0b2dbfa)
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