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 % 

 

 

 

 

 

 

 

 

 

posted @ 2020-11-25 21:04  anobscureretreat  阅读(929)  评论(0编辑  收藏  举报