侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

查询ip归属地的shell脚本

2022-06-18 星期六 / 0 评论 / 0 点赞 / 112 阅读 / 1088 字

#!/bin/bashipp(){exec<$1whilereadadostring1=`curl-s"http://www.ip138.com/ips138.asp?ip=${a}&action=2

.

#!/bin/bashipp(){exec < $1while read adostring1=`curl -s "http://www.ip138.com/ips138.asp?ip=${a}&action=2"|iconv -f gb2312 -t utf-8|grep '<ul class="ul1"><li>' | awk -F '[<>]+' '{print substr($5,7)}'`echo $aecho -e "/033[44;37;5m $string1 /033[0m"done}case $1 in-f)shiftipp $1;;-i)shiftstring1=`curl -s "http://www.ip138.com/ips138.asp?ip=${1}&action=2"| iconv -f gb2312 -t utf-8 |grep '<ul class="ul1"><li>' | awk -F '[<>]+'    '{print substr($5,7)}'`echo $1echo -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


.

广告 广告

评论区