|
- # cat whois.file
- inetnum: 58.16.0.0 - 58.16.255.255
- netname: CNCGROUP-GZ
- descr: CNC Group Guizhou province network
- descr: China Network Communications Group Corporation
- descr: No.156,Fu-Xing-Men-Nei Street,
- descr: Beijing 100031
- country: CN
- admin-c: CH455-AP
- tech-c: CH455-AP
- remarks: service provider
- mnt-by: APNIC-HM
- mnt-lower: MAINT-CNCGROUP-GZ
- mnt-routes: MAINT-CNCGROUP-RR
- status: ALLOCATED PORTABLE
- changed: [email]hm-[email]changed@apnic.net[/email][/email] 20050125
- changed: [email]hm-[email]changed@apnic.net[/email][/email] 20050218
- source: APNIC
- inetnum: 58.14.0.0 - 58.15.255.255
- netname: JNGDNET
- country: CN
- descr: Jinan Radio &TV Wellunited
- descr: Digital Cable TV Co., Ltd
- descr: 3F Sanjianyinyuan Building,No.22 minsheng Road,
- descr: Jinan, Shandong, P.R.China
- admin-c: JX211-AP
- tech-c: JX211-AP
- status: ALLOCATED PORTABLE
- changed: [email]shenzhi@cnnic.cn[/email] 20050623
- mnt-by: MAINT-CNNIC-AP
- source: APNIC
复制代码- # cat isp.list
- CNCGROUP
- CHINANET
- CSTNET
- CERNET
- CMNET
- UNINET
- CRNET
- CIETNET
复制代码
我whois ip 58.16.0.0和58.14.0.0后,想知道他们属于哪个运营商
isp.list是八大骨干的名字
如果不在isp.list,我想优先取netname那栏的名字
比如我列的文本得到的结果应该是 58.16.0.0 属于CNCGROUP
58.14.0.0 属于JNGDNET
而不是CNCGROUP-GZ
我whois $ip | grep -f isp.list出来是CNCGROUP-GZ ,怎样能简单得转换成isp.list里面的名字?
可以有什么方法?? 先谢谢各位的帮忙:wink: |
|