Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- log="access_simulado.log"
- ranking="ranking.txt"
- arr=($(cat $log | cut -d "-" -f 1|cut -d "." -f 1,2,3 | sed 's/ *$//'))
- declare -a checked
- declare -a subnet
- for subnet_portion in ${arr[@]};do
- if echo ${checked[@]} | grep -w $subnet_portion > /dev/null;then
- continue
- fi
- counted=$(cat $log | grep $subnet_portion | wc -l)
- echo "${counted} - ${subnet_portion}.0/24" >> $ranking
- checked+=($subnet_portion)
- done
- sort -r $ranking
Advertisement
Add Comment
Please, Sign In to add comment