1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudcatcher/parse_interface_ips.awk

17 lines
274 B

BEGIN {
ORS = ""; # We control the output separator in END
ip_count = 0;
}
/inet6?/ {
gsub("/[0-9]+$", "", $2); # Remove the subnet from the end
ips[ip_count++] = $2;
}
END {
for(i = 0 ; i < ip_count ; i++) {
print(ips[i]);
if(i < ip_count - 1) print(", ");
}
}