- #!/bin/bash
-
while read line
-
do
-
echo $line
-
ip=$(echo -en $line | awk '{print $3}' | awk -F"/" '{print $1}')
-
echo $ip
-
add=$(wget -q http://www.ip168.com/ip/?ip=${ip} -O - | grep "本站主数据" | sed 's/^[ \t]*//' | awk -F"
"
'{print $1}' | sed
's/本站主数据://')
echo $add
echo -en $line | sed "/${ip}/s/\(.*\)/\1 $add\n/" >> ip_addr.txt
done < ip.txt
从ip138取需要用下面的替换掉上面的add
add=$(wget -q "" -O -| iconv -f gbk -t utf-8 | grep "数据" | awk -F"ul" '{print $3}' | awk -F"" '{print $1$2}' | awk -F"" '{print $2"\n"$3}' | head -1)
阅读(3754) | 评论(0) | 转发(0) |