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