From 06f257d4829b8873b92bff42ae09b7623e8717be Mon Sep 17 00:00:00 2001 From: yzenati <9922120+yzenati@users.noreply.github.com> Date: Fri, 16 Oct 2020 13:26:28 +0200 Subject: [PATCH] Change the way the separation of weater_condition and temperature are made, so it can take minus 0 temperature in celcius --- scripts/weather.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/weather.sh b/scripts/weather.sh index c8e3ad9..faa2783 100755 --- a/scripts/weather.sh +++ b/scripts/weather.sh @@ -31,8 +31,8 @@ display_weather() fi weather_information=$(fetch_weather_information $display_weather) - weather_condition=$(echo $weather_information | cut -d "+" -f 1 | cut -d "-" -f 1) # Sunny, Snow, etc - temperature=$(echo $weather_information | cut -d '+' -f 2) # +31°C, -3°F, etc + weather_condition=$(echo $weather_information | rev | cut -d ' ' -f2- | rev) # Sunny, Snow, etc + temperature=$(echo $weather_information | rev | cut -d ' ' -f 1 | rev) # +31°C, -3°F, etc unicode=$(forecast_unicode $weather_condition) echo "$unicode ${temperature/+/}" # remove the plus sign to the temperature