Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- export LC_CTYPE=C
- input_file=$1
- output_path=$2
- views=($(awk 'BEGIN { ORS = "\n" } $9 == 200 {print $1":"$10}' ${input_file}))
- unique_views=($(echo "${views[*]}" | awk -F : '{arr[$1]+=$2} END {for (i in arr) {print i,arr[i]}}'))
- IFS=$'\n' sorted=($(sort -k 2,2 <<< "${unique_views[*]}"))
- printf "%s\n" "${sorted[@]}" > $2/sorted_unique_views
- tail -10 $2/sorted_views
- broken=($(awk 'BEGIN { ORS = "\n" } $9 != 200 {print $7}' ${input_file}))
- #broken_uniq=$(printf "%s\n" "${broken[@]}" | tr '\r' '\n' | sort | uniq)
- printf "%s\n" "${broken[@]}" | sort | uniq > $2/broken_relocated
- echo -e "\n\n################Broken or relocated"
- tail -10 $2/broken_relocated
Add Comment
Please, Sign In to add comment