add city variable

This commit is contained in:
Aditya 2023-03-01 14:07:39 +05:30
parent 5418211665
commit 68b1a561a1

View file

@ -6,7 +6,8 @@
get_weather()
{
curl -s v2.wttr.in | grep -e "Weather" | sed -n 2p | sed s/Weather://g | sed 's/,//g' | sed 's/+//g' | sed 's/°C.*/°C/' | sed 's/.*m//'
CITY=Chandigarh
curl -s v2.wttr.in/$CITY | grep -e "Weather" | sed -n 2p | sed s/Weather://g | sed 's/,//g' | sed 's/+//g' | sed 's/°C.*/°C/' | sed 's/.*m//'
}