RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
查询ip归属地的shell脚本
#!/bin/bash
ipp(){
exec < $1
while read a
do
string1=`curl -s "http://www.ip138.com/ips138.asp?ip=${a}&action=2"|iconv -f gb2312 -t utf-8|grep '
  • ' | awk -F '[<>]+' '{print substr($5,7)}'` echo $a echo -e "\033[44;37;5m $string1 \033[0m" done } case $1 in -f) shift ipp $1 ;; -i) shift string1=`curl -s "http://www.ip138.com/ips138.asp?ip=${1}&action=2"| iconv -f gb2312 -t utf-8 |grep '
  • ' | awk -F '[<>]+'    '{print substr($5,7)}'` echo $1 echo -e "\033[44;37;5m $string1 \033[0m" ;; *) echo "[Help] $0 need -f or -i -f ------ argument is a file -i ------ argument is a IP [For example]: $0 -f filename $0 -f ipaddress " ;; esac

  • 分享标题:查询ip归属地的shell脚本
    网页URL:http://sczitong.cn/article/gphejc.html