bash 按行读取内容 两种写法: #!/bin/bash # 写法1 cat test.txt | while read line do echo "1:${line}" done # 写法2 while read line do echo "2:${line}" done < test.txt 运行截图: 未分类 桩白墨 2021-04-12 2 热度 0评论