shell 循环打印出文件所有行

code

macname@localhost Desktop % cat test.sh 
while read line;do
echo $line;
done < a.txt
macname@localhost Desktop % 
macname@localhost Desktop % cat a.txt 
1dededede
2dedefrfr
3frhvfvfvf
4frfrdede
5frfrfrfrf
6frfrede
7jukitttt
8csxssss
9zaxss
10swwww
11ssssss
12aaaaa
macname@localhost Desktop % ./test.sh 
1dededede
2dedefrfr
3frhvfvfvf
4frfrdede
5frfrfrfrf
6frfrede
7jukitttt
8csxssss
9zaxss
10swwww
11ssssss
12aaaaa
macname@localhost Desktop % 

原文地址:https://www.cnblogs.com/sea-stream/p/14038715.html