#! /bin/csh -f # Reads an httpd error log from standard input, # selects bad accesses to or from local users, # writes a summary of the form COUNT REFERRER -> BADLINK, # sorted by user name grep -v 'Connection ' \ | grep -v 'Timed out ' \ | sed \ -e 's/%7E/~/' \ -e 's/^\[[^]]*\] \[[^]]*\] //' \ -e 's/^\[host: [^] ]* referer: \([^]]*\)\]/\1 -> /' \ -e 's/^\[host: [^ ]*\] /? -> /' \ | sort \ | uniq -c \ | grep -e '\.dcc\.unicamp\.br/[~%]' \ | sort -t~ +1