Change the way the separation of weater_condition and temperature are made, so it can take minus 0 temperature in celcius

This commit is contained in:
yzenati 2020-10-16 13:26:28 +02:00
parent 9d9a5d2b14
commit 06f257d482

View file

@ -31,8 +31,8 @@ display_weather()
fi fi
weather_information=$(fetch_weather_information $display_weather) weather_information=$(fetch_weather_information $display_weather)
weather_condition=$(echo $weather_information | cut -d "+" -f 1 | cut -d "-" -f 1) # Sunny, Snow, etc weather_condition=$(echo $weather_information | rev | cut -d ' ' -f2- | rev) # Sunny, Snow, etc
temperature=$(echo $weather_information | cut -d '+' -f 2) # +31°C, -3°F, etc temperature=$(echo $weather_information | rev | cut -d ' ' -f 1 | rev) # +31°C, -3°F, etc
unicode=$(forecast_unicode $weather_condition) unicode=$(forecast_unicode $weather_condition)
echo "$unicode ${temperature/+/}" # remove the plus sign to the temperature echo "$unicode ${temperature/+/}" # remove the plus sign to the temperature