blob: dbd3e22188c3f89cda071b83de30431a52fe24a4 [file] [log] [blame]
Mike Frysinger78f9d8e2009-03-28 18:55:34 +00001# first try some invalid patterns (do in subshell due to parsing error)
Denys Vlasenkobe669fa2017-07-25 15:25:07 +02002# (set argv0 to "SHELL" to avoid "/path/to/shell: blah" in error messages)
Denys Vlasenkobe669fa2017-07-25 15:25:07 +02003"$THIS_SH" -c 'echo ${:-}' SHELL
Mike Frysinger78f9d8e2009-03-28 18:55:34 +00004
5# now some funky ones
6echo _${#-} _${#:-}
7
8# now some valid ones
9set --
10echo _$1 _${1-} _${1:-} _${1-word} _${1:-word}
11
12set -- aaaa
13echo _$1 _${1-} _${1:-} _${1-word} _${1:-word}
14
15unset f
16echo _$f _${f-} _${f:-} _${f-word} _${f:-word}
17
18f=
19echo _$f _${f-} _${f:-} _${f-word} _${f:-word}
20
21f=fff
22echo _$f _${f-} _${f:-} _${f-word} _${f:-word}
Denys Vlasenko9e0adb92019-05-15 13:39:19 +020023
24set --
25set -- "${1-}"; echo 1:$#
26set --
27set -- ${1-}; echo 0:$#