1 # do all of these in subshells since it's supposed to error out
5 # first try some invalid patterns
6 "$THIS_SH" -c 'echo ${:}'
7 "$THIS_SH" -c 'echo ${::}'
8 "$THIS_SH" -c 'echo ${:1}'
9 "$THIS_SH" -c 'echo ${::1}'
11 #this also is not valid in bash, but we accept it:
12 "$THIS_SH" -c 'echo ${var:}'
14 # then some funky ones
15 # UNFIXED BUG: this should work: "$THIS_SH" -c 'echo ${?:0}'
18 "$THIS_SH" -c 'set --; echo "1 =|${1}|"'
19 "$THIS_SH" -c 'set --; echo "1:1 =|${1:1}|"'
20 "$THIS_SH" -c 'set --; echo "1:1:2=|${1:1:2}|"'
21 "$THIS_SH" -c 'set --; echo "1::2 =|${1::2}|"'
23 "$THIS_SH" -c 'set -- 0123; echo "1 =|${1}|"'
24 "$THIS_SH" -c 'set -- 0123; echo "1:1 =|${1:1}|"'
25 "$THIS_SH" -c 'set -- 0123; echo "1:1:2=|${1:1:2}|"'
26 "$THIS_SH" -c 'set -- 0123; echo "1::2 =|${1::2}|"'
28 "$THIS_SH" -c 'unset f; echo "f =|$f|"'
29 "$THIS_SH" -c 'unset f; echo "f:1 =|${f:1}|"'
30 "$THIS_SH" -c 'unset f; echo "f:1:2=|${f:1:2}|"'
31 "$THIS_SH" -c 'unset f; echo "f::2 =|${f::2}|"'
33 "$THIS_SH" -c 'f=; echo "f =|$f|"'
34 "$THIS_SH" -c 'f=; echo "f:1 =|${f:1}|"'
35 "$THIS_SH" -c 'f=; echo "f:1:2=|${f:1:2}|"'
36 "$THIS_SH" -c 'f=; echo "f::2 =|${f::2}|"'
38 "$THIS_SH" -c 'f=a; echo "f =|$f|"'
39 "$THIS_SH" -c 'f=a; echo "f:1 =|${f:1}|"'
40 "$THIS_SH" -c 'f=a; echo "f:1:2=|${f:1:2}|"'
41 "$THIS_SH" -c 'f=a; echo "f::2 =|${f::2}|"'
43 "$THIS_SH" -c 'f=0123456789; echo "f =|$f|"'
44 "$THIS_SH" -c 'f=0123456789; echo "f:1 =|${f:1}|"'
45 "$THIS_SH" -c 'f=0123456789; echo "f:1:2=|${f:1:2}|"'
46 "$THIS_SH" -c 'f=0123456789; echo "f::2 =|${f::2}|"'