001、
[root@pc1 test02]# ls a.txt [root@pc1 test02]# cat a.txt ## 测试文件 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 [root@pc1 test02]# cat a.txt | while IFS= read i; do echo $i; done ## 一种方式 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 [root@pc1 test02]# while IFS= read i; do echo $i; done < a.txt ## 二种方式 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
。