Shell读取文件内容
2008-05-07 16:44
295 查看
原贴:http://hi.baidu.com/telpublic/blog/item/67df9cde1b2a945dcdbf1ae0.html
Shell读取文件内容
2008-05-05 23:33
类别:Linux | 添加到搜藏 | 浏览(3) | 评论 (0)
/*var pre = [true,'详解自动挂载文件系统autofs', '详解自动挂载文件系统autofs','/telpublic/blog/item/cd5fb151eaeb292143a75b50.html'];
var post = [false,'','', '/telpublic/blog/item/.html'];
if(pre[0] || post[0]){
document.write(' ');
if(pre[0]){
document.write('上一篇: + ']' + pre[2] + ' ');
}
if(post[0]){
document.write('下一篇: + ']' + post[2] + '');
}
document.write('');
}
/*]]>*/
Shell读取文件内容
2008-05-05 23:33
while read wOne wTwo wThree do [ -z $wOne ] && continue #测试此行内容是否为空 xxx=$wOne #提取内容 done < /var/xxx/one.txt echo "$xxx" #变量获取了文件中的内容 以下方法无法提取内容;但可以输出。问题似乎出在bash对管道的处理方法上 (bash可能生成了一个子shell处理管道输出)。 ------------------------------------------------------------------------------------------------------------ cat /var/xxx/one.txt | while read wOne wTwo wThree do [ -z $wOne ] && continue #测试此行内容是否为空 xxx=$wOne #提取内容 done echo "$xxx" #这里变量内容没有改变 |
/*var pre = [true,'详解自动挂载文件系统autofs', '详解自动挂载文件系统autofs','/telpublic/blog/item/cd5fb151eaeb292143a75b50.html'];
var post = [false,'','', '/telpublic/blog/item/.html'];
if(pre[0] || post[0]){
document.write(' ');
if(pre[0]){
document.write('上一篇: + ']' + pre[2] + ' ');
}
if(post[0]){
document.write('下一篇: + ']' + post[2] + '');
}
document.write('');
}
/*]]>*/
相关文章推荐
- 如何写一个能够读取文件并显示全部内容,计数行数的shell
- shell读取文件夹里的文件内容并输出
- shell:读取文件的每一行内容并输出
- shell:读取文件的每一行内容并输出
- shell:读取文件的每一行内容并输出
- shell:读取文件的每一行内容并输出
- shell for while 循环用来一行一行读取文件内容
- shell读取文件中的内容,并将其存入到变量中
- shell:读取文件的每一行内容并输出
- shell:读取文件的每一行内容并输出
- Shell读取文件内容
- shell:读取文件的每一行内容并输出
- shell:读取文件的每一行内容并输出
- shell读取文件内容
- shell 实现读取文件某行的内容
- shell读取文件中的内容,并将其存入到变量中
- 一个读取文件内容的shell脚本
- shell脚本按行读取文件内容的方法
- shell中3中种读取文件内容的方法
- shell:读取文件的每一行内容并输出