#! /bin/sh LIST="/tmp/iana.$$.txt" fetch -o $LIST http://www.iana.org/assignments/ipv4-address-space/ cat $LIST | grep '\(LEGACY\|UNALLOCATED\|ALLOCATED\)' | grep '\(ARIN\|APNIC\|LACNIC\|AfriNIC\)' | awk '$1' | grep -v '\(010\|172\|147\|192\)' | sed 's/^[0]*\([0-9]*\)\/.*/\1.0.0.0\/8/' rm $LIST