On 8/10/20 5:56 PM, L A Walsh wrote:
> I wanted to use a map that looked like this:
>
> declare -A switches=([num]=(one two three)), where '(one two three)'
> is an associated list. Ideally, I could access it like other arrays:
> for types in ${switches[num][@]}; do...
> or
> switches[num]=(one
> On Aug 10, 2020, at 6:44 PM, Eli Schwartz wrote:
>
> Instead of asking:
>
> "Can bash please implement multidimensional arrays as I think they're
> nifty and would like to use them."
Some prior art:
https://lists.gnu.org/archive/html/bug-bash/2011-09/msg00061.html
I wanted to use a map that looked like this:
declare -A switches=([num]=(one two three)), where '(one two three)'
is an associated list. Ideally, I could access it like other arrays:
for types in ${switches[num][@]}; do...
or
switches[num]=(one two three)#gives:
-bash:
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-musl
Compiler: gcc
Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security
uname output: Linux 28e237a5e16f 5.5.7-200.fc31.x86_64 #1 SMP Fri Feb 28
17:18:37 UTC 2020 x86_64 GNU/Linux
Machine