shell脚本:一次读取文件的一行【转】
2013-01-22 19:24
585 查看
写法一:
#!/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脚本:一次读取文件的一行,并输出
- shell脚本:一次读取文件的一行,并输出
- shell脚本:一次读取文件的一行【转】
- shell脚本:一次读取文件的一行,并输出
- shell脚本中一次读取文件中的一行
- Shell脚本一次读取文件中一行的2种写法
- shell脚本:一次读取文件的一行,并输出
- shell脚本中一次读取文件中的一行
- shell脚本:一次读取文件的一行,并输出
- Shell脚本一次读取文件中一行的2种写法
- shell脚本中每次读取文件的一行
- Shell脚本循环读取文件中的每一行
- shell脚本,每次读取文件的一行,逐行读取并处理
- 利用Shell脚本循环读取文件中每一行的方法详解
- shell脚本,每次读取文件的一行,逐行读取并处理
- 读取文件的每一行内容并输出 的shell脚本实现
- shell读取文件的每一行内容并输出【转】
- shell读取文件每一行的方式
- shell脚本读取ini配置文件的值
- shell for while 循环用来一行一行读取文件内容