wttr.in/share/bash-function.txt
Pierce Griffiths 9a59cc67bf
Fixed error in bash function
Replaced "$COLUMNS" with "$(tput cols)", because shell variables are not exported to child processes.
2019-07-06 13:02:20 -05:00

7 lines
208 B
Text

wttr()
{
# change Paris to your default location
local request="wttr.in/${1-Paris}"
[ "$(tput cols)" -lt 125 ] && request+='?n'
curl -H "Accept-Language: ${LANG%_*}" --compressed "$request"
}