shell语言处理多行合并一行问题
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://qq164587043.blog.51cto.com/261469/58754 |
刚处理问题时需要将 system_finger.txt中的两行合并起来中间以分号作分割符。 system_finger.txt内容为: fc7:2.6.23.1 Fedora release 7 (Moonshine) 查找下资料知道用awk可以完成这项艰巨的任务。 awk '{if(NR%2==0){printf $0}else{printf "%s:",$0}}' > system_fingerprint.txt cat system_fingerprint.txt 看看 fc7:2.6.23.1:Fedora release 7 (Moonshine) good ! 本文出自 “国产0与1” 博客,请务必保留此出处http://qq164587043.blog.51cto.com/261469/58754 本文出自 51CTO.COM技术博客 |


hello_world
博客统计信息
热门文章
最新评论
友情链接
