逐行读取文本文件的示例代码如下:
while read line do echo $line done < data.txt
或者:
cat data.txt | while read line do echo $line done