You can write:
while IFS= read -r line
do
echo "$line"
done <<< "$the_list"
See §3.6.7 "Here Strings" in the Bash Reference Manual.
(I've also taken the liberty of adding some double-quotes, and adding -r
and IFS=
to read
, to avoid too much mucking around with the contents of your variables.)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…