shell 脚本读取文件内容并输出--问题总结(编码问题)

shell脚本读取文件主要介绍两种方式:

第一种:

#/bin/bash
while read line
do
   echo $line
done < a.txt

第二种:

#/bin/bash
cat a.txt | while read line
do
   echo $line
done

原文地址:https://www.cnblogs.com/ycycn/p/13788371.html