5 STATION_ID
="$1" # ICAO designator. e.g. KJFK, KBOS
7 FILE_METAR_DECODED
="$HOME/var/run/metar-${STATION_ID}-decoded"
8 FILE_TEMP_FAHRENHEIT
="${FILE_METAR_DECODED}-temp-fahrenheit"
9 FILE_TEMP_CELSIUS
="${FILE_METAR_DECODED}-temp-celsius"
11 (metar
-d "$STATION_ID" 2>&1) > $FILE_METAR_DECODED # TODO: Better error handling
14 -v file_fahrenheit
="$FILE_TEMP_FAHRENHEIT" \
15 -v file_celsius
="$FILE_TEMP_CELSIUS" \
17 /METAR pattern not found in NOAA data/ {
23 fahrenheit = (celsius * (9 / 5)) + 32;
28 print "--" > file_fahrenheit
29 print "--" > file_celsius
31 print fahrenheit > file_fahrenheit
32 print celsius > file_celsius
This page took 0.07084 seconds and 4 git commands to generate.