一个查看天气的脚本(修改自“大骨头”的)

点这里下载:weathertar.gz

./weather

然后直接输入城市名字

比如:上海

就行了

#!/bin/bash
#Copyright (c) 2007 bones7456 (bones7456@gmail.com)
#edited by percy(pengjianqing@sina.com)1/5/2007
#License: GPLv3
echo “please keyin the city code”
echo -n “city:”
read city
city=`grep “$city” ./city.txt |cut -d “-” -f1`
#城市代码,留空可自动检测(自动检测不一定精确),城市代码可在 http://weather.265.com 上查询,是个5位的数字
#city=

if …