你的位置:首页 > 脚本语言

查询IP地址归属地shell脚本

2015-03-01 浏览:(4956) 脚本语言 评论(0)

#!/bin/bashipp (){exec < $1while read adosring=`curl -s  "http://ip138.com/ips138.asp?ip=${a}&action=2" |grep '<ul class="ul1"><li>' |awk -F'[><]+' '{
print $5}'`echo $a $sringdone}case $1 in-f)
        shift
        ipp $1;;-i)
        shift
        sring=`curl -s  "http://ip138.com/ips138.asp?ip=${1}&action=2" |grep '<ul class="ul1"><li>' |awk -F'[
><]+' '{print $5}'`
        echo $1 $sring;;*)
        echo "[Help]
        $0 need -f or -i
        -f ------- argument is a file
        -i ------- argument is a IP
[For example]:
        $0 -f filename
        $0 -i ipadress
        ";;esac

  • 发表评论
  • 查看评论
【暂无评论!】

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。