mirror of
https://github.com/TECHNOFAB11/tmux2k.git
synced 2025-12-11 23:50:08 +01:00
Fix potential errors in scripts
This commit is contained in:
parent
8c7f582b53
commit
c1493ce604
7 changed files with 31 additions and 31 deletions
|
|
@ -36,16 +36,16 @@ display_weather()
|
|||
fi
|
||||
weather_information=$(fetch_weather_information $display_weather)
|
||||
|
||||
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)
|
||||
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
|
||||
}
|
||||
|
||||
forecast_unicode()
|
||||
{
|
||||
weather_condition=$(echo $weather_condition | awk '{print tolower($0)}')
|
||||
weather_condition=$(echo "$weather_condition" | awk '{print tolower($0)}')
|
||||
|
||||
if [[ $weather_condition =~ 'snow' ]]; then
|
||||
echo '❄ '
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue