Tomato 1.26 beta(1766)
[tomato.git] / release / src / router / busybox / shell / hush_test / hush-vars / param_expand_indicate_error.tests
blobbccba3e1b6bac956121feec4b45ea9304efe4159
1 # do all of these in subshells since it's supposed to error out
3 # first try some invalid patterns
4 #"$THIS_SH" -c 'echo ${?}' -- this is valid as it's the same as $?
5 "$THIS_SH" -c 'echo ${:?}'
7 # then some funky ones
8 "$THIS_SH" -c 'echo ${#?}'
9 "$THIS_SH" -c 'echo ${#:?}'
11 # now some valid ones
12 "$THIS_SH" -c 'set --; echo _$1'
13 "$THIS_SH" -c 'set --; echo _${1?}'
14 "$THIS_SH" -c 'set --; echo _${1:?}'
15 "$THIS_SH" -c 'set --; echo _${1?message1}'
16 "$THIS_SH" -c 'set --; echo _${1:?message1}'
18 "$THIS_SH" -c 'set -- aaaa; echo _$1'
19 "$THIS_SH" -c 'set -- aaaa; echo _${1?}'
20 "$THIS_SH" -c 'set -- aaaa; echo _${1:?}'
21 "$THIS_SH" -c 'set -- aaaa; echo _${1?word}'
22 "$THIS_SH" -c 'set -- aaaa; echo _${1:?word}'
24 "$THIS_SH" -c 'unset f; echo _$f'
25 "$THIS_SH" -c 'unset f; echo _${f?}'
26 "$THIS_SH" -c 'unset f; echo _${f:?}'
27 "$THIS_SH" -c 'unset f; echo _${f?message3}'
28 "$THIS_SH" -c 'unset f; echo _${f:?message3}'
30 "$THIS_SH" -c 'f=; echo _$f'
31 "$THIS_SH" -c 'f=; echo _${f?}'
32 "$THIS_SH" -c 'f=; echo _${f:?}'
33 "$THIS_SH" -c 'f=; echo _${f?word}'
34 "$THIS_SH" -c 'f=; echo _${f:?message4}'
36 "$THIS_SH" -c 'f=fff; echo _$f'
37 "$THIS_SH" -c 'f=fff; echo _${f?}'
38 "$THIS_SH" -c 'f=fff; echo _${f:?}'
39 "$THIS_SH" -c 'f=fff; echo _${f?word}'
40 "$THIS_SH" -c 'f=fff; echo _${f:?word}'