wttr.in
wttr.in copied to clipboard
Only show sign when temperature is negative.
curl 'wttr.in/?format=%t\n&m' returns, e. g., +10°C. I want it to be just 10°C unless the temperature is bellow zero. So -10°C should have a sign while positive should not. Is this possible? Also, for curl 'wttr.in/?format=%s\n&m', is there a way to not get seconds? E. g., hh:mm:ss should be hh:mm without messing with the system's localisation settings.
curl -s 'wttr.in/?format=%t\n&m' | tr -d +
Removes the + from the output:
$ curl -s 'wttr.in/?format=%t\n&m' | tr -d +
> 5°C
Hope this helps