[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Expansions in associative array subscripts
From: |
Stephane Chazelas |
Subject: |
Re: [Help-bash] Expansions in associative array subscripts |
Date: |
Wed, 7 Aug 2019 14:33:24 +0100 |
User-agent: |
NeoMutt/20171215 |
2019-08-07 08:49:16 -0400, Greg Wooledge:
[...]
> > "${associativeArray[*]}"
>
> The one-character string * is the key. No globbing is done.
[...]
${associativeArray[*]} and ${associativeArray[@]} are
special and expand to value of all elements similarly to
Bourne's "$@" and "$*". That's only when literal. With k=*;
${associativeArray[$k]} still gets you the value for the literal
"*" key like ${associativeArray["*"]} or even
${associativeArray[""*]}.
--
Stephane