2012年8月13日

摘要: 要查找查log文件带有“Capabilities-Exchange”字符串的行,并打印它的前5行和后5行awk '{a[NR%5]=$0}/Capabilities-Exchange/{print "******************************************************";\for(i=NR-4;i<=NR;i++ ) if(i>0) print a[i%5];i=0;while(i<5 && getline){print;i++ }}' ./test.log 阅读全文
posted @ 2012-08-13 15:28 山本二十八 阅读(191) 评论(0) 推荐(0) 编辑

导航