Here's what I'm trying. What I want is the last echo
to say "one two three four test1..." as it loops. It's not working; read line
is coming up empty. Is there something subtle here or is this just not going to work?
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 < <( echo <<EOM
test1
test2
test3
test4
EOM
)