From dce65ed1813fc7fe3e28323797d89b5656a4146a Mon Sep 17 00:00:00 2001 From: Alexander Meshcheryakov Date: Sat, 15 Dec 2018 14:21:08 +0300 Subject: [PATCH] Guess user location when running `weather ""` Omitting colon makes bash substitute default location only when parameter is absent. Therefore empty city name propagates to wttr.in and allows it to guess. --- share/bash-function.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/bash-function.txt b/share/bash-function.txt index f3cda23..56783e4 100644 --- a/share/bash-function.txt +++ b/share/bash-function.txt @@ -1,7 +1,7 @@ wttr() { # change Paris to your default location - local request="wttr.in/${1:-Paris}" + local request="wttr.in/${1-Paris}" [ "$COLUMNS" -lt 125 ] && request+='?n' curl -H "Accept-Language: ${LANG%_*}" --compressed "$request" }