Skip to content

Instantly share code, notes, and snippets.

@logcat
Last active April 5, 2021 14:48
Show Gist options
  • Save logcat/7039f38fd67aef358fcd5fe5db5fbb3f to your computer and use it in GitHub Desktop.
Save logcat/7039f38fd67aef358fcd5fe5db5fbb3f to your computer and use it in GitHub Desktop.
wttr.in shell function. source it and use as "weather city"
function weather() {
LANG_BACK=$LANG
LANG=uk_UA.UTF-8
curl -s -H "Accept-Language: ${LANG%_*}" "wttr.in/$1" | sed '$ d' | sed '$ d'
LANG=$LANG_BACK
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment