- 论坛徽章:
- 0
|
awk -F":" 'BEGIN{"date +%Y%m%d-%H:%M"|getline time }{if($4 in mac )print "[",time,"]", $0; else mac[$4]=$0}' filename
把文件中所有 MAC 大于 1条的找出来,是不是就这个意思?
结果:
[ 20070914-21:28 ] RFC1213-MIB::atPhysAddress.4.1.192.168.3.1 = Hex-STRING: 00 D0 D0 C0 78 00
[ 20070914-21:28 ] RFC1213-MIB::atPhysAddress.5.1.192.168.5.1 = Hex-STRING: 00 D0 D0 C0 78 00
[ 20070914-21:28 ] RFC1213-MIB::atPhysAddress.6.1.192.168.7.1 = Hex-STRING: 00 D0 D0 C0 78 00
[ 20070914-21:28 ] RFC1213-MIB::atPhysAddress.7.1.192.168.8.1 = Hex-STRING: 00 D0 D0 C0 78 00
[ 20070914-21:28 ] RFC1213-MIB::atPhysAddress.8.1.192.168.1.12 = Hex-STRING: 00 50 8D F1 C1 53
[ 20070914-21:28 ] RFC1213-MIB::atPhysAddress.8.1.192.168.1.254 = Hex-STRING: 00 D0 D0 C0 78 00
[ 20070914-21:28 ] RFC1213-MIB::atPhysAddress.9.1.192.168.0.1 = Hex-STRING: 00 D0 D0 C0 78 00
[ 20070914-21:28 ] RFC1213-MIB::atPhysAddress.10.1.192.168.10.1 = Hex-STRING: 00 D0 D0 C0 78 00
[ 20070914-21:28 ] RFC1213-MIB::atPhysAddress.11.1.192.168.201.1 = Hex-STRING: 00 D0 D0 C0 78 00
[ 20070914-21:28 ] RFC1213-MIB::atPhysAddress.12.1.192.168.202.1 = Hex-STRING: 00 D0 D0 C0 78 00 |
|