- 论坛徽章:
- 0
|
本帖最后由 xmi 于 2011-02-15 10:54 编辑
...不好意思,我应该用code包起来的,后面的括号掉了
cjaizss 发表于 2011-02-14 13:55 ![]()
这个没有error出现, 但只出现下面两行结果....- %awk '$0~/event/{next}{a[$NF]++}END{for( i in a)print "event",i,a[i];}' log
- event 1
- event 09Feb11-14:00:01:052 1
- %
复制代码 那么第二那个要怎改呢?- awk '$0!~/event/{next}{gsub(/'\''/,"",$(NF-3));a[$NF]=a[$NF]"\n" $1 " "$(NF-3)}END{print "lequipmentlocation: USA";for(i in a){print "event code:",i;sub(/\n/,"",a[i]);print a[i];print "";};}' log
- awk: illegal statement near line 1
- awk: syntax error near line 1
- awk: illegal statement near line 1
- awk: syntax error near line 1
- %
复制代码 谢谢您! |
|