Number of public IP address in an AS (example IAM)

You can get the number of public address in an AS by using whois and ipcalc tools like this query :
$ for ip in $(whois -i origin AS6713 | awk ‘/route/ { print $2 }’); do ipcalc $ip; done | awk ‘/\/Net/{ ip+=$2 } END { printf ip “\n” }’