天气预报的超短 Shell

Weather

保存为weather.sh

chmod +x weather.sh

然后 ./weather.sh 上海

即能得到上海近两天的天气预报

#!/bin/bash
w3m -dump "http://wap.baidu.com/s?word=$1&ssid=0&from=0&bd_page_type=1&ct_6=天气查询" 2>/dev/null | sed '2,5!d'