Fixed error in bash function

Replaced "$COLUMNS" with "$(tput cols)", because shell variables are not exported to child processes.
pull/323/head
Pierce Griffiths 5 years ago committed by GitHub
parent a1517df21f
commit 9a59cc67bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save