shell脚本中每次读取文件的一行

2023-06-02,,

写法一:
#!/bin/bash
while read line
do
      echo $line     #这里可根据实际用途变化
done < file          #需要读取的文件名

_____________________________________________________

写法二:

#!/bin/bash

cat urfile | while read line
do
    echo $line
done

shell脚本每次读取文件的一行的相关教程结束。

《shell脚本中每次读取文件的一行.doc》

下载本文的Word格式文档,以方便收藏与打印。