title: Bash: Split a string into an array
body: <p>First of all, let me state that I am very new to Bash scripting. I have tried to look for solutions for my problem, but couldn't find any that worked for me.<br>
  Let's assume I want to use bash to parse a file that looks like the following:</p>
  
  <pre><code>variable1 = value1
  variable2 = value2
  </code></pre>
  
  <p>I split the file line by line using the following code:</p>
  
  <pre><code>cat /path/to/my.file | while read line; do
      echo $line      
  done
  </code></pre>
  
  <p>From the <code>$line</code> variable I want to create an array that I want to split using <code>=</code> as a delimiter, so that I will be able to get the variable names and values from the array like so:</p>
  
  <pre><code>$array[0] #variable1
  $array[1] #value1
  </code></pre>
  
  <p>What would be the best way to do this?</p>