ash: import param_expand_default.tests from hush
[oweals/busybox.git] / shell / hush_test / hush-vars / param_expand_default.tests
1 # first try some invalid patterns (do in subshell due to parsing error)
2 # (set argv0 to "SHELL" to avoid "/path/to/shell: blah" in error messages)
3 # valid in bash and ash (same as $-), not supported in hush (yet?):
4 "$THIS_SH" -c 'echo ${-}' SHELL
5 "$THIS_SH" -c 'echo ${:-}' SHELL
6
7 # now some funky ones
8 echo _${#-} _${#:-}
9
10 # now some valid ones
11 set --
12 echo _$1 _${1-} _${1:-} _${1-word} _${1:-word}
13
14 set -- aaaa
15 echo _$1 _${1-} _${1:-} _${1-word} _${1:-word}
16
17 unset f
18 echo _$f _${f-} _${f:-} _${f-word} _${f:-word}
19
20 f=
21 echo _$f _${f-} _${f:-} _${f-word} _${f:-word}
22
23 f=fff
24 echo _$f _${f-} _${f:-} _${f-word} _${f:-word}