- 论坛徽章:
- 145
|
本帖最后由 jason680 于 2016-05-09 22:25 编辑
回复 1# 哭过的天空
$ awk 'function x(s, t,n,r){split(s,_x,FS);t=asort(_x);for(n=1;n<=t;++n)r=r _x[n]" ";return(r)}{v=$NF;NF-=2;k=x($0);if(!d[k]++)b[++c]=k;a[k]=a[k]v" "}END{for(n=1;n<=c;++n)print b[n]"- "a[b[n]]}' FILE
111.7.161.3 111.7.161.5 111.7.161.7 111.7.161.9 - hebeiyd henanyd ningxiayd shanxi1yd shanxi3yd
122.141.231.231 - heilongjianglt
...
119.84.68.68 - sichuandx
117.177.240.37 117.177.240.38 117.177.240.39 117.177.240.40 117.177.240.64 - sichuanyd
|
|