mirror of
https://github.com/sheumann/hush.git
synced 2024-08-15 02:29:00 +00:00
Some people like to use ${?} rather than $?, so make sure we support all the special single char vars that use this form. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
41 lines
1.2 KiB
Plaintext
Executable File
41 lines
1.2 KiB
Plaintext
Executable File
# do all of these in subshells since it's supposed to error out
|
|
|
|
# first try some invalid patterns
|
|
#"$THIS_SH" -c 'echo ${?}' -- this is valid as it's the same as $?
|
|
"$THIS_SH" -c 'echo ${:?}'
|
|
|
|
# then some funky ones
|
|
"$THIS_SH" -c 'echo ${#?}'
|
|
"$THIS_SH" -c 'echo ${#:?}'
|
|
|
|
# now some valid ones
|
|
"$THIS_SH" -c 'set --; echo _$1'
|
|
"$THIS_SH" -c 'set --; echo _${1?}'
|
|
"$THIS_SH" -c 'set --; echo _${1:?}'
|
|
"$THIS_SH" -c 'set --; echo _${1?message1}'
|
|
"$THIS_SH" -c 'set --; echo _${1:?message1}'
|
|
|
|
"$THIS_SH" -c 'set -- aaaa; echo _$1'
|
|
"$THIS_SH" -c 'set -- aaaa; echo _${1?}'
|
|
"$THIS_SH" -c 'set -- aaaa; echo _${1:?}'
|
|
"$THIS_SH" -c 'set -- aaaa; echo _${1?word}'
|
|
"$THIS_SH" -c 'set -- aaaa; echo _${1:?word}'
|
|
|
|
"$THIS_SH" -c 'unset f; echo _$f'
|
|
"$THIS_SH" -c 'unset f; echo _${f?}'
|
|
"$THIS_SH" -c 'unset f; echo _${f:?}'
|
|
"$THIS_SH" -c 'unset f; echo _${f?message3}'
|
|
"$THIS_SH" -c 'unset f; echo _${f:?message3}'
|
|
|
|
"$THIS_SH" -c 'f=; echo _$f'
|
|
"$THIS_SH" -c 'f=; echo _${f?}'
|
|
"$THIS_SH" -c 'f=; echo _${f:?}'
|
|
"$THIS_SH" -c 'f=; echo _${f?word}'
|
|
"$THIS_SH" -c 'f=; echo _${f:?message4}'
|
|
|
|
"$THIS_SH" -c 'f=fff; echo _$f'
|
|
"$THIS_SH" -c 'f=fff; echo _${f?}'
|
|
"$THIS_SH" -c 'f=fff; echo _${f:?}'
|
|
"$THIS_SH" -c 'f=fff; echo _${f?word}'
|
|
"$THIS_SH" -c 'f=fff; echo _${f:?word}'
|