目录/Table of Content
大家好,我是一个喜欢研究算法、机械学习和生物计算的小青年,我的CSDN博客是:一骑代码走天涯
如果您喜欢我的笔记,那么请点一下关注、点赞和收藏。如果內容有錯或者有改进的空间,也可以在评论让我知道。😄
While loop in bash
有一个文档 test.txt::
apple
banana
cherry
durian
eggplant
然后用 bash 的 while-loop 把內容一行行显示出来:
while read fruit; do
echo "$fruit"
done <test.txt:
Reference/参考资料:
https://stackoverflow.com/questions/1521462/looping-through-the-content-of-a-file-in-bash