title: Can I read line from a heredoc in bash?
body: <p>Here's what I'm trying. What I want is the last <code>echo</code> to say "one two three four test1..." as it loops. It's not working; <code>read line</code> is coming up empty. Is there something subtle here or is this just not going to work?</p>
  
  <pre><code>array=( one two three )
  echo ${array[@]}
  #one two three
  array=( ${array[@]} four )
  echo ${array[@]}
  #one two three four
  
  
  while read line; do
          array=( ${array[@]} $line )
          echo ${array[@]}
  done &lt; &lt;( echo &lt;&lt;EOM
  test1
  test2
  test3
  test4
  EOM
  )
  </code></pre>