shell read line

cat >b <<EOF
line1
line2
line3
EOF
# 方法1
while read line
do
    echo ${line}
done < <(cat b)
# 方法2
cat b|while read line
do
    echo ${line}
done
# 方法3
while read line
do
    echo ${line}
done < b
原文地址:https://www.cnblogs.com/chenzechao/p/9675156.html