Created
December 14, 2020 15:34
-
-
Save sdstrowes/0f312746916f81da18ad4b0aa5f96113 to your computer and use it in GitHub Desktop.
get inet6num records with assignment-size fields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -s https://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz 2>/dev/null | | |
gzcat | | |
awk -F: ' | |
BEGIN { | |
gotone = false | |
lines[0] = "" | |
} | |
/^$/ { | |
if (gotone) { | |
for (l = 0; l < i; l++) { | |
print lines[l] | |
} | |
} | |
i = 0 | |
gotone = 0 | |
delete lines | |
} | |
{ | |
lines[i] = $0 | |
i++ | |
if ($1 == "assignment-size") { | |
gotone = 1 | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment