#!/bin/sh
if [ $# -eq 1 ]
then
city=$1
elif [ $# -eq 0 ]
then
city=beijing
else
echo "请输入城市(拼音)" >&2
return 1
fi
w3m -dump "http://weather1.sina.cn/?code=$city" 2> /dev/null | sed '1,/更换城市/d;/\[1\]/,$d'
#!/bin/sh
if [ $# -eq 1 ]
then
city=$1
elif [ $# -eq 0 ]
then
city=beijing
else
echo "请输入城市(拼音)" >&2
return 1
fi
w3m -dump "http://weather1.sina.cn/?code=$city" 2> /dev/null | sed '1,/更换城市/d;/\[1\]/,$d'