1.使用while
#!/bin/bashwhile read linedo echo $linedone < file.txt
#!/bin/bashcat file.txt | while read linedo echo $linedone
2.使用for
for line in `cat file.txt`do echo $linedone
本文共 236 字,大约阅读时间需要 1 分钟。
1.使用while
#!/bin/bashwhile read linedo echo $linedone < file.txt
#!/bin/bashcat file.txt | while read linedo echo $linedone
2.使用for
for line in `cat file.txt`do echo $linedone
转载于:https://www.cnblogs.com/sssblog/p/10304624.html