人生最大的悲哀莫过于迷失自我而无法自拔!
发布时间:2012-12-20 22:28:01
Sed Advanced commands:h:清空之前的hold space,并将当前的pattern space内容复制到hold space中去。H:将当前的pattern space中的内容追加到hold space中去,导致hold space内容变为:hold space contents\npattern space contentsg:将hold space的内容拷贝并覆盖当前pattern space的内容G:将hold space的内容追加到当前的pattern space中去。导致pattern space内容变为:pattern space contents\nhold......【阅读全文】
发布时间:2012-12-20 00:27:00
将文件的上下两行合并为一行:[root@web-db bash]# time sed -n -e 'N;s/\n/:/;p' emp.txt.........Jason Smith:IT ManagerRaj Reddy:SysadminAnand Ram:DeveloperJane Miller:Sales Managerreal 0m1.606suser 0m0.008ssys 0m0.008s[root@web-db bash]# time awk '{arr[x++]=$0}END{for(x=0;x<......【阅读全文】
发布时间:2012-12-19 23:51:28
[root@web-db bash]# cat emp.txtyes Manageryes Manager1Managerhello ManagerJohn DoeCEOJason SmithIT ManagerRaj ReddySysadminAnand RamDeveloperJane MillerSales Managerworld Manager[root@web-db bash]#处理要求:打印包含Manager行的上一行,如果Manager出现在第一行,那么也要打印出来:实现方式:群内:我为SUN疯狂.乐看[root@web-db bash]# sed -n '1{/Manager......【阅读全文】
发布时间:2012-12-19 23:19:53
[root@web-db bash]# cat emp.txtyes Manager1Managerhello ManagerJohn DoeCEOJason SmithIT ManagerRaj ReddySysadminAnand RamDeveloperJane MillerSales Managerworld Manager[root@web-db bash]#文本处理要求:打印包含Manager行的上一行内容,如果Manager出现在第一行,那么第一行也需要打印之。处理方式:[root@web-db bash]# awk '{arr[x++]=$0};END{for(x=0;x<......【阅读全文】
发布时间:2012-12-19 17:11:43
[root@web-db bash]# for name in au hk; do curl -w '%{time_connect} %{time_namelookup} %{time_total}\n' www.google.com.$name -so /dev/null; done0.179 0.060 0.4560.215 0.092 0.501[root@web-db bash]#......【阅读全文】