Skip to content

Instantly share code, notes, and snippets.

@ldante86
Last active November 9, 2016 04:28
Show Gist options
  • Select an option

  • Save ldante86/8f6d30c040ccc80c259cd8a6a0238775 to your computer and use it in GitHub Desktop.

Select an option

Save ldante86/8f6d30c040ccc80c259cd8a6a0238775 to your computer and use it in GitHub Desktop.
get temperature by metar station name
#!/bin/bash
if [ "$1" ]; then
declare -u metar="$1"
curl -s http://tgftp.nws.noaa.gov/weather/current/${metar}.html | \
grep -A 5 Temperature | grep "F ([0-9]" | awk -F ">" '{print $3}' | sed 's/(.*//' | sed 's/^ *//'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment