title: Bash Parse Arrays From Config File
body: <p>I need to have an array for each "section" in the file containing:</p>
  
  <pre><code>[array0]
  value1=asdf
  value2=jkl
  
  [array1]
  value1=1234
  value2=5678
  </code></pre>
  
  <p>I want to be able to retrieve these values like this:</p>
  
  <pre><code>echo ${array0[value1]}
  echo ${array0[value2]}
  
  echo ${array1[value1]}
  echo ${array1[value2]}
  </code></pre>
  
  <p>Any thoughts on how to accomplish this? (Explanations would be a bonus)</p>
  
  <p>I've already read these anwsers but none do exactly what I want to do.</p>
  
  <p><a href="https://stackoverflow.com/questions/4434797/read-a-config-file-in-bash-without-using-source">Read a config file in BASH without using &quot;source&quot;</a></p>
  
  <p><a href="https://stackoverflow.com/questions/16571739/bash-parsing-variables-from-config-file">BASH Parsing variables from config file</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15684646/array-like-data-structure-in-bash-config-file">Array like data structure in bash (config file)?</a></p>