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 3 热度 0评论