china-operator-ip/stat.sh
Yifan Gao ea485fe7e4 refact shell script
* fix wget save to a wrong file name with a same name file
* beautify log format
* print asn on log
* modify/add DEBUG, SKIP_DATA_PREPARATION environment variables
2017-03-10 21:52:04 +08:00

20 lines
239 B
Bash
Executable File

#!/usr/bin/env bash
source common.sh
cd result
ls *.txt |
while read file; do
echo ${file%.*}
cat $file |
awk -F\/ '{print $2}' |
(
sum=0
while read n; do
((s=32-n))
((sum+=1<<s))
done
echo $sum
)
echo
done > stat