title: Iterate over lists embedded as values in key/value pairs in bash
body: <p>I'm trying to get a (key,multiple-value) structure (some sort of hashmap) in bash, like this :</p>
  
  <pre><code>[   
    [ "abc" : 1, 2, 3, 4 ],
    [ "def" : "w", 33, 2 ]    
  ]
  </code></pre>
  
  <p>I'd like to iterate through eack key (some kind of <code>for key in ...</code>, and get each value with something like <code>map["def",2]</code> or  <code>map[$key,2]</code>.</p>
  
  <p>I've seen a couple of threads talking about single-value hashmap, but nothing about this issue.</p>
  
  <p>I could go with <code>N</code> arrays, <code>N</code> being the amount of key in my map, filled with every field in a row, but I don't want to duplicate code as much as possible.</p>
  
  <p>Thanks in advance !</p>
  
  <p>Edit : 
  I'd like to go through the structure with something like this :</p>
  
  <pre><code>for key in ${map[@]} do;
    echo $key # "abc" then "def"
    for value in ${map[$key,@]} do;
      ...
    done
  done
  </code></pre>