title: Array like data structure in bash (config file)?
body: <p>I've written a bash script, which process multiple files. I now want to add support for a config file. This is my wanted data structure:</p>
  
  <pre><code>Array ( 
      [0] =&gt; Array (
          [name] =&gt; datset1
          [path] =&gt; /var/lib/bliTool/ds1
          [type] =&gt; cvs
      )
  
      [1] =&gt; Array (
          [name] =&gt; datset2
          [path] =&gt; /var/lib/bliTool/ds2
          [type] =&gt; xml
      )
  
      [2] =&gt; Array (
          [name] =&gt; datset3
          [path] =&gt; /home/igor/test/ds3
          [type] =&gt; cvs
      )
  )
  </code></pre>
  
  <p><strong>Q1</strong> Is such a data structure possible within bash? Are there other recommendations? Remember, this should be in a config file...</p>
  
  <p><strong>Q2:</strong> I am thinking about one configuration file per 'set' like</p>
  
  <pre><code>/etc/myApp/
  /etc/myApp/myApp.conf
  /etc/myApp/datasets.d/
  /etc/myApp/datasets.d/ds1.conf
  /etc/myApp/datasets.d/ds2.conf
  /etc/myApp/datasets.d/dsN.conf
  </code></pre>
  
  <p>and each <em>/etc/myApp/datasets.d/dsN.conf</em> file would look like</p>
  
  <pre><code>name=The DS name
  path=/the/path/to/the/ds/files
  type=thetype
  </code></pre>
  
  <p>What do you recommend? Is there a way to do everything in one file?</p>
  
  <p><strong>Q3:</strong> I want to support multiple path values per set. I could support something like</p>
  
  <pre><code>path="/first/path /second/path"
  </code></pre>
  
  <p>But I think I'll get trouble with spaces, so I should introduce a delimeter like</p>
  
  <pre><code>path="/first/path:/second/path"
  </code></pre>
  
  <p>to split the string.</p>
  
  <p>Or is there a better way?</p>