首页 > 技术文章 > shell脚本--逐行读取文件内容

ccku 2020-08-19 17:39 原文

#!/bin/env bash
while read line
do
    echo $line
done < ./age.txt
#!/bin/env bash
for i in `cat age.txt`
do
    echo $i
done
#!/bin/env bash
exec < age.txt
while read line
do
    echo $line
done

推荐阅读