shell脚本:一次读取文件的一行【转】
2010-10-31 11:46
489 查看
写法一:
#!/bin/bash
while read line
do
echo $line #这里可根据实际用途变化
done < urfile
写法二:
#!/bin/bash
cat urfile | while read line
do
echo $line
done
注意:以上代码中urfile 为被读取的文件
#!/bin/bash
while read line
do
echo $line #这里可根据实际用途变化
done < urfile
写法二:
#!/bin/bash
cat urfile | while read line
do
echo $line
done
注意:以上代码中urfile 为被读取的文件
相关文章推荐
- Shell脚本一次读取文件中一行的2种写法
- shell脚本:一次读取文件的一行,并输出
- shell脚本中一次读取文件中的一行
- shell脚本:一次读取文件的一行【转】
- shell脚本:一次读取文件的一行,并输出
- shell脚本:一次读取文件的一行,并输出
- Shell脚本一次读取文件中一行的2种写法
- shell脚本:一次读取文件的一行,并输出
- shell脚本中一次读取文件中的一行
- shell脚本:一次读取文件的一行,并输出
- shell脚本中每次读取文件的一行
- Shell脚本循环读取文件中的每一行
- 利用Shell脚本循环读取文件中每一行的方法详解
- shell脚本,每次读取文件的一行,逐行读取并处理
- shell脚本,每次读取文件的一行,逐行读取并处理
- 读取文件的每一行内容并输出 的shell脚本实现
- shell:读取文件的每一行内容并输出
- 通过shell脚本实现从文件中读取数据的几种方法
- shell脚本按行读取配置文件并解析
- Java使用FileReader(file)、readLine()读取文件,以行为单位,一次读一行,一直读到null时结束,每读一行都显示行号。