现在放出修改版
代码: 全选
#!/bin/bash
city=$1
#=======get weather from wap.baidu.com
wget -q -O /tmp/baidu_weather.html "http://wap.baidu.com/tq?&ssid=0&from=0&area=${city}&uid=frontui_1265135393_3194&vit=tj&bd_page_type=1"
infom=`cat /tmp/baidu_weather.html |grep ${city}天气 `
echo ${infom##*天气} |awk -F\<br\/\> '{for(i=1;i<NF;i++) print $i }' |sed -e 's/<\/div>//' -e 's/<br>//' -e 's/\[.*\]//' -e 's/[1-9]*-[1-9]*\,......\,//' -e '/^$/d'
这里是老板========仅供学习,目前彻底无法使用
这样使用: 在此下载: