title: Trying to store grep result into array but want each value to be stored as a different key
body: <p>Hi I am new to scripting and am trying to get my hear around arrays.</p>
  
  <p>I have created a text file called colours which contains the following data:</p>
  
  <pre><code>1=red
  2=black
  3=blue
  </code></pre>
  
  <p>I want to store each colour into a array as a separate key,  but the code I use below stores result as a single key.  I think I need to grep line by line in the loop but not sure</p>
  
  <pre><code>#!/bin/bash
  declare -a result1
  for result in $(grep 1= colours |cut -d "=" -f 2)
  do
      result1+=("$result")
  done
  echo ${result1[@]}
  </code></pre>