I am trying to create a list of CIDRs for Google's computers. When I issue in Linux whois -h whois.radb.net -- '-i origin AS15169' | grep ^route: | sed 's/.* //'
. The list is excessively long and redundant. For example, at the end, I see:
216.239.58.0/23
216.239.58.0/24
216.239.59.0/24
216.239.60.0/23
216.239.60.0/24
216.239.61.0/24
216.239.62.0/23
216.239.62.0/24
216.239.63.0/24
These are all part of a subnet listed a few screens above, 216.239.32.0/19
.
Is there an easy way in Bash to reduce the number of lines? Searching SO, I found some Python one-liners, but I'd like to run this on Bash, if possible.