本帖最后由 yangbosos 于 2012-12-24 14:35 编辑
有这一样一个文件,
内容如下:
1,act,secKill,172.24.138.91,0,0,0,34776,13366,/data/postmall/tomcat/webapps_act/secKill,2012-12-14
2,act,secKill,172.24.138.92,0,0,0,34776,13366,/data/postmall/tomcat/webapps_act/secKill,2012-12-14
3,act,secKill,172.24.138.93,0,0,0,34776,13366,/data/postmall/tomcat/webapps_act/secKill,2012-12-14
4,act,secKill,172.24.138.94,0,0,0,34776,13366,/data/postmall/tomcat/webapps_act/secKill,2012-12-14
5,act,groupbuy,172.24.138.64,9090,0,0,40670,26646,/data/postmall/tomcat/webapps_act/groupbuy,2012-12-14
6,act,groupbuy,172.24.138.123,9090,0,0,40670,26646,/data/postmall/tomcat/webapps_act/groupbuy,2012-12-14
7,act,lottery,172.24.138.64,9090,0,0,35311,18247,/data/postmall/tomcat/webapps_act/lottery,2012-12-14
8,act,lottery,172.24.138.123,9090,0,0,35311,18247,/data/postmall/tomcat/webapps_act/lottery,2012-12-14
9,act,promoeng,172.24.138.64,9090,0,0,40670,38204,/data/postmall/tomcat/webapps_act/promoeng,2012-12-14
10,act,promoeng,172.24.138.123,9090,0,0,40670,38204,/data/postmall/tomcat/webapps_act/promoeng,2012-12-14
11,dw,jreport,172.24.154.177,8080,0,0,42019,24019,/data/postmall/tomcat/webapps_birt/jreport,2012-12-20
12,bankcall,bankcall,172.24.138.45,9090,0,0,112205,65786,/data/postmall/tomcat/webapps_monitor/bankcall,2012-12-14
13,card,ROOT,172.24.138.74,8080,0,0,41611,50709,/data/postmall/tomcat/webapps_ulecard/ROOT,2012-12-14
14,card,ROOT,172.24.138.75,8080,0,0,41611,50709,/data/postmall/tomcat/webapps_ulecard/ROOT,2012-12-14
15,card,ROOT,172.24.138.182,8080,0,0,41611,50709,/data/postmall/tomcat/webapps_ulecard/ROOT,2012-12-14
16,card,ROOT,172.24.138.183,8080,0,0,41611,50709,/data/postmall/tomcat/webapps_ulecard/ROOT,2012-12-14
17,cart,ROOT,172.24.138.45,8080,0,0,40895,45550,/data/postmall/tomcat/webapps_cart/ROOT,2012-12-14
18,cart,ROOT,172.24.138.46,8080,0,0,40895,45551,/data/postmall/tomcat/webapps_cart/ROOT,2012-12-14
请问,怎么用awk实现,第二列相同的数行内,第九列也相同,就打OK,否则no
1,act,secKill,172.24.138.91,0,0,0,34776,13366,/data/postmall/tomcat/webapps_act/secKill,2012-12-14
2,act,secKill,172.24.138.92,0,0,0,34776,13366,/data/postmall/tomcat/webapps_act/secKill,2012-12-14
3,act,secKill,172.24.138.93,0,0,0,34776,13366,/data/postmall/tomcat/webapps_act/secKill,2012-12-14
4,act,secKill,172.24.138.94,0,0,0,34776,13366,/data/postmall/tomcat/webapps_act/secKill,2012-12-14
这四行吧,第二列相同吧,第九列也相同,然后打印OK出来
17,cart,ROOT,172.24.138.45,8080,0,0,40895,45550,/data/postmall/tomcat/webapps_cart/ROOT,2012-12-14
18,cart,ROOT,172.24.138.46,8080,0,0,40895,45551,/data/postmall/tomcat/webapps_cart/ROOT,2012-12-14
第二列相同吧,第九列不相同,然后打印no出来
|