shell脚本使用curl批量解析号码归属地
时间:2014-11-05 12:12 来源:linux.it.net.cn 作者:IT
一例使用curl批量解析号码归属地的shell脚本代码。
例子:
复制代码代码示例:
#!/bin/bash
# File Name: area.sh
# Created Time: 2013年07月03日 星期三 19时57分00秒
# 格式:号码前七位+**** 归属地:省 市
#----------------------
telno_file=roam_telno
cat ${telno_file} |while read telno
do
#只送号段过去
telno_hd=`echo $telno |cut -c 1-7`
show_telno=${telno_hd}****
re=`curl -s wap.ip138.com/sim_search.asp?mobile=$telno_hd|sed -n '15p'|sed 's#<br/>##g'`
echo "${show_telno} $re" >>$telno_file_y
done
(责任编辑:IT)
一例使用curl批量解析号码归属地的shell脚本代码。
例子:
复制代码代码示例:
#!/bin/bash
(责任编辑:IT)# File Name: area.sh # Created Time: 2013年07月03日 星期三 19时57分00秒 # 格式:号码前七位+**** 归属地:省 市 #---------------------- telno_file=roam_telno cat ${telno_file} |while read telno do #只送号段过去 telno_hd=`echo $telno |cut -c 1-7` show_telno=${telno_hd}**** re=`curl -s wap.ip138.com/sim_search.asp?mobile=$telno_hd|sed -n '15p'|sed 's#<br/>##g'` echo "${show_telno} $re" >>$telno_file_y done |