Ecco cosa sto cercando. Quello che voglio è l'ultimo echo
dire "uno due tre quattro test1 ..." mentre scorre. La sua non funziona; read line
sta arrivando vuoto. C'è qualcosa di sottile qui o semplicemente non funzionerà?Posso leggere la riga da un heredoc in bash?
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
)
'array + = ("quattro")' e 'array + = ("$ riga")' –