これが私が試していることです。私が欲しいのは、echo
ループするときに最後に「one two three four test1...」と言うことです。動いていない; read line
が空になります。ここに微妙な何かがありますか、それともうまくいきませんか?
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
)