Wednesday, October 2, 2013

Linux Bash Script to get a TAF Forecast From the Console

Usage:
taf [ICAO STATION ID]
Example: $taf kslc

Save the following in a file called taf:
#!/bin/bash
station=$(echo "$1" | tr '[:lower:]' '[:upper:]')
wget -q -O /home/$USER/taftmp http://weather.noaa.gov/pub/data/forecasts/taf/stations/$station.TXT
echo " "
more /home/$USER/taftmp
echo " "
rm /home/$USER/taftmp

No comments:

Post a Comment