title: How to create dictionary using shell script
body: <p>I have a file status.txt which is in the following format:</p>
  
  <pre><code>1|A|B
  2|C|D
  </code></pre>
  
  <p>Now i have to read this file in shell script and create a dictionary like:</p>
  
  <pre><code>dictionary['1'] = ['A', 'B']
  dictionary['2'] = ['C', 'D']
  </code></pre>
  
  <p>I am able read the content of file using this:</p>
  
  <pre><code>while read line
      do
          key=$line | cut --d="|" -f1
          data1=$line | cut --d="|" -f2
          data2=$line | cut --d="|" -f3
      done &lt; "status.txt"
  </code></pre>
  
  <p>Can anybody help me in creating the dictionary as mentioned above.</p>