mirror of
https://github.com/gaoyifan/china-operator-ip.git
synced 2025-07-13 21:02:37 +08:00
count the number of IP
This commit is contained in:
parent
768cdf6da2
commit
7ff126697e
18
generate.sh
18
generate.sh
@ -41,3 +41,21 @@ while read file; do
|
||||
get_asn $file | xargs bgptools | docker run -i --rm gaoyifan/cidrmerge > result/$operator.txt
|
||||
>&2 echo "done"
|
||||
done
|
||||
|
||||
# count the number of IP
|
||||
cd result
|
||||
ls |
|
||||
while read file; do
|
||||
echo ${file%.*}
|
||||
cat $file |
|
||||
awk -F\/ '{print $2}' |
|
||||
(
|
||||
sum=0
|
||||
while read n; do
|
||||
s=$((32 - ${n}))
|
||||
sum=$(($sum + 1<<$s))
|
||||
done
|
||||
echo $sum
|
||||
)
|
||||
echo
|
||||
done > stat
|
||||
|
Loading…
Reference in New Issue
Block a user