Introduction
Introduction Statistics Contact Development Disclaimer Help
Tweak METAR. - annna - Annna the nice friendly bot.
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6…
Log
Files
Refs
Tags
README
---
commit cad8a5b2dba5c57467da56bcb34bb6826aa7b62b
parent e3433aaa403accf2277a80e9fa6ac5ceaef6b933
Author: eidolon <?>
Date: Fri, 25 Oct 2024 13:43:42 -0400
Tweak METAR.
Signed-off-by: Annna Robert-Houdin <[email protected]>
Diffstat:
M metar | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/metar b/metar
@@ -5,12 +5,13 @@ iata2icao() {
}
printart() {
- awk 'BEGIN { RS = ""; srand() } { a[NR] = $0 } END { print a[int(rand()*le…
+ awk 'BEGIN { RS = ""; srand() } { if (rand() < 1 / ++n) out = $0 } END { p…
}
dromeinfo() {
awk -v aerodrome="$1" --csv '
- BEGIN { aerodrome = toupper(aerodrome) } NR == 1 { split($0, header) }
+ BEGIN { aerodrome = toupper(aerodrome) }
+ NR == 1 { split($0, header) }
$1 == aerodrome || $10 == aerodrome {
for (i = 1; i <= NF; i++)
if ($i)
@@ -23,7 +24,7 @@ dromeinfo() {
END { if (!s) exit; print s }' "$csv"
}
-if ! id=$(printf '%s\n' "$1" | grep '^[A-Za-z]\{3,4\}$'); then
+if ! id=$(printf '%s\n' "$1" | grep '^[A-Za-z0-9]\{3,4\}$'); then
printf '%s\n' "invalid IATA/ICAO code."
exit 1
fi
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.