title: Bash script to convert a string with space delimited tokens to an array
body: <p>I have a string</p>
  
  <pre><code>echo $STRING
  </code></pre>
  
  <p>which gives</p>
  
  <pre><code>first second third fourth fifth
  </code></pre>
  
  <p>basically a list separated spaces.</p>
  
  <p>how do i take that string and make it an array so that</p>
  
  <pre><code>array[0] = first
  array[1] = second
  </code></pre>
  
  <p>etc..</p>
  
  <p>I have tried</p>
  
  <pre><code>IFS=' ' read -a list &lt;&lt;&lt; $STRING
  </code></pre>
  
  <p>but then when i do an </p>
  
  <pre><code>echo ${list[@]}
  </code></pre>
  
  <p>it only prints out "first" and nothing else</p>