#!/bin/csh -f # webstats # ----------------------------------------------------------------------------- # C shell script to search the ITF log for actions on the specified release. # ----------------------------------------------------------------------------- # Revision History: # $Log$ # ----------------------------------------------------------------------------- if ($1 == "-?") then set verb = $0 echo "Usage: $verb:t" exit 1 endif pushd /var/log/httpd > /dev/null # Create file to search and winnow down, with grep-style filename prefixes on # the lines. grep -v CrapolaNeverGonnaHappenCrapola access_log* >! ~/webstats.tmp # Initialize the file of counters. echo -n "" > ~/webstats.tmp3 echo "------------------------------------------------------------------------" echo "Known browsers, including bots in (Other) -- Grouped by vendor" echo -n "------------------------------------------------------------------------" set ANS = $< echo "Gecko/Total (Firefox, Netscape, Safari, Konquerer, Pandora, etc.) " echo -n " " grep Gecko ~/webstats.tmp | wc -l echo -n "Firefox/Total " | tee -a ~/webstats.tmp3 grep Firefox ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 echo -n "Firefox/2.0 " | tee -a ~/webstats.tmp3 grep Firefox/2.0 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Firefox/2.0 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Firefox/1.5 " | tee -a ~/webstats.tmp3 grep Firefox/1.5 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Firefox/1.5 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Firefox/1.0 " | tee -a ~/webstats.tmp3 grep Firefox/1.0 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Firefox/1.0 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Firefox/1.4 " | tee -a ~/webstats.tmp3 grep Firefox/1.4 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Firefox/1.4 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Firefox/0.10 " | tee -a ~/webstats.tmp3 grep Firefox/0.10 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Firefox/0.10 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Firefox/0.9 " | tee -a ~/webstats.tmp3 grep Firefox/0.9 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Firefox/0.9 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Firefox/Other " | tee -a ~/webstats.tmp3 grep Firefox ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 echo -n "MSIE/Total " | tee -a ~/webstats.tmp3 grep MSIE ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 echo -n "MSIE/7.0 " | tee -a ~/webstats.tmp3 grep MSIE\ 7.0 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v MSIE\ 7.0 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "MSIE/6.0 " | tee -a ~/webstats.tmp3 grep MSIE\ 6.0 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v MSIE\ 6.0 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "MSIE/5.0 " | tee -a ~/webstats.tmp3 grep MSIE\ 5.0 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v MSIE\ 5.0 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "MSIE/5.5 " | tee -a ~/webstats.tmp3 grep MSIE\ 5.5 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v MSIE\ 5.5 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "MSIE/5.17 " | tee -a ~/webstats.tmp3 grep MSIE\ 5.17 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v MSIE\ 5.17 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "MSIE/5.23 " | tee -a ~/webstats.tmp3 grep MSIE\ 5.23 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v MSIE\ 5.23 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "MSIE/4.0 " | tee -a ~/webstats.tmp3 grep MSIE\ 4.0 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v MSIE\ 4.0 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp # echo -n "MSIE/3.0 " | tee -a ~/webstats.tmp3 # grep MSIE\ 3.0 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # grep -v MSIE\ 3.0 ~/webstats.tmp >! ~/webstats.tmp2 # cp ~/webstats.tmp2 ~/webstats.tmp echo -n "MSIE/Other " | tee -a ~/webstats.tmp3 grep MSIE ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 echo -n "Netscape/Total " | tee -a ~/webstats.tmp3 grep Netscape ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 echo -n "Netscape/8 " | tee -a ~/webstats.tmp3 grep Netscape/8 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Netscape/8 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Netscape/7 " | tee -a ~/webstats.tmp3 grep Netscape/7 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Netscape/7 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp # echo -n "Netscape/6 " | tee -a ~/webstats.tmp3 # grep Netscape/6 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # grep -v Netscape/6 ~/webstats.tmp >! ~/webstats.tmp2 # cp ~/webstats.tmp2 ~/webstats.tmp # # echo -n "Netscape/4 " | tee -a ~/webstats.tmp3 # grep Netscape/4 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # grep -v Netscape/4 ~/webstats.tmp >! ~/webstats.tmp2 # cp ~/webstats.tmp2 ~/webstats.tmp # # echo -n "Netscape/3 " | tee -a ~/webstats.tmp3 # grep Netscape/3 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # grep -v Netscape/3 ~/webstats.tmp >! ~/webstats.tmp2 # cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Netscape/Other " | tee -a ~/webstats.tmp3 grep Netscape ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 echo -n "Safari " | tee -a ~/webstats.tmp3 grep Safari ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Safari ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Konqueror " | tee -a ~/webstats.tmp3 grep Konqueror ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Konqueror ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Pandora " | tee -a ~/webstats.tmp3 grep Pandora ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Pandora ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "SeaMonkey " | tee -a ~/webstats.tmp3 grep SeaMonkey ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v SeaMonkey ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Minefield " | tee -a ~/webstats.tmp3 grep Minefield ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Minefield ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Iceweasel " | tee -a ~/webstats.tmp3 grep Iceweasel ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Iceweasel ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Camino " | tee -a ~/webstats.tmp3 grep Camino ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Camino ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Gecko/Other " | tee -a ~/webstats.tmp3 grep Gecko ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Gecko ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp # echo -n "Gecko/Total " | tee -a ~/webstats.tmp3 # grep Gecko/ ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # echo -n "Gecko/20 " | tee -a ~/webstats.tmp3 # grep Gecko/20 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # grep -v Gecko/20 ~/webstats.tmp >! ~/webstats.tmp2 # cp ~/webstats.tmp2 ~/webstats.tmp # echo -n "Gecko/20070605 " | tee -a ~/webstats.tmp3 # grep Gecko/20070605 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # grep -v Gecko/20070605 ~/webstats.tmp >! ~/webstats.tmp2 # cp ~/webstats.tmp2 ~/webstats.tmp # # echo -n "Gecko/20070410 " | tee -a ~/webstats.tmp3 # grep Gecko/20070410 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # grep -v Gecko/20070410 ~/webstats.tmp >! ~/webstats.tmp2 # cp ~/webstats.tmp2 ~/webstats.tmp # # echo -n "Gecko/20060414 " | tee -a ~/webstats.tmp3 # grep Gecko/20060414 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # grep -v Gecko/20060414 ~/webstats.tmp >! ~/webstats.tmp2 # cp ~/webstats.tmp2 ~/webstats.tmp # # echo -n "Gecko/20050915 " | tee -a ~/webstats.tmp3 # grep Gecko/20050915 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # grep -v Gecko/20050915 ~/webstats.tmp >! ~/webstats.tmp2 # cp ~/webstats.tmp2 ~/webstats.tmp # # echo -n "Gecko/20040220 " | tee -a ~/webstats.tmp3 # grep Gecko/20040220 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # grep -v Gecko/20040220 ~/webstats.tmp >! ~/webstats.tmp2 # cp ~/webstats.tmp2 ~/webstats.tmp # # echo -n "Gecko/20030703 " | tee -a ~/webstats.tmp3 # grep Gecko/20030703 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # grep -v Gecko/20030703 ~/webstats.tmp >! ~/webstats.tmp2 # cp ~/webstats.tmp2 ~/webstats.tmp # # echo -n "Gecko/20021016 " | tee -a ~/webstats.tmp3 # grep Gecko/20021016 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # grep -v Gecko/20021016 ~/webstats.tmp >! ~/webstats.tmp2 # cp ~/webstats.tmp2 ~/webstats.tmp # echo -n "Gecko/Other " | tee -a ~/webstats.tmp3 # grep Gecko/ ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # ---------------------------------------------------------------------------- # The browsers below don't use Gecko. Also, IE which is above for speed. # ---------------------------------------------------------------------------- echo -n "Opera " | tee -a ~/webstats.tmp3 grep Opera ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Opera ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Moz5-compat " | tee -a ~/webstats.tmp3 grep Mozilla/5\.0\ \(compatible\;\) ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Mozilla/5\.0\ \(compatible\;\) ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Moz4-compat " | tee -a ~/webstats.tmp3 grep Mozilla/4\.0\ \(compatible\;\) ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Mozilla/4\.0\ \(compatible\;\) ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Moz3-compat " | tee -a ~/webstats.tmp3 grep Mozilla/3\.01\ \(compatible\;\) ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 grep -v Mozilla/3\.01\ \(compatible\;\) ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "(Other) " | tee -a ~/webstats.tmp3 cat ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 # Sort, echo and delete counts. echo "------------------------------------------------------------------------" echo "Known browsers, including bots in (Other) -- Ordered by count" echo -n "------------------------------------------------------------------------" set ANS = $< sort -k2 -n -r < ~/webstats.tmp3 echo -n "" > ~/webstats.tmp3 #echo "------------------------------------------------------------------------" #echo "Known bots and remaining (Other) -- Ordered by subtraction order" #echo -n "------------------------------------------------------------------------" #set ANS = $< # Note: Tee to /dev/null is inefficient, but makes it easy to delete # the redirection to /dev/null in the future, to see the order in # which items were counted and subtracted from the total, so that # they are missing from subsequent counts that might have found them. # For debugging, or in case the numbers seem suspicious. echo -n "Googlebot " | tee -a ~/webstats.tmp3 > /dev/null grep Googlebot ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Googlebot ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Yahoo\!_Slurp " | tee -a ~/webstats.tmp3 > /dev/null grep Yahoo\!\ Slurp ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Yahoo\!\ Slurp ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "favicon.ico " | tee -a ~/webstats.tmp3 > /dev/null grep favicon.ico ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v favicon.ico ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "robots.txt " | tee -a ~/webstats.tmp3 > /dev/null grep robots.txt ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v robots.txt ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Jeeves " | tee -a ~/webstats.tmp3 > /dev/null grep Jeeves ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Jeeves ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "msnbot " | tee -a ~/webstats.tmp3 > /dev/null grep msnbot ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v msnbot ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "VoilaBot " | tee -a ~/webstats.tmp3 > /dev/null grep VoilaBot ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v VoilaBot ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Baiduspider " | tee -a ~/webstats.tmp3 > /dev/null grep Baiduspider ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Baiduspider ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "SurveyBot " | tee -a ~/webstats.tmp3 > /dev/null grep SurveyBot ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v SurveyBot ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Steeler " | tee -a ~/webstats.tmp3 > /dev/null grep Steeler ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Steeler ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "NaverBot " | tee -a ~/webstats.tmp3 > /dev/null grep NaverBot ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v NaverBot ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Nutch " | tee -a ~/webstats.tmp3 > /dev/null grep Nutch ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Nutch ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "psbot " | tee -a ~/webstats.tmp3 > /dev/null grep psbot ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v psbot ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Sogou " | tee -a ~/webstats.tmp3 > /dev/null grep Sogou ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Sogou ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Factbot " | tee -a ~/webstats.tmp3 > /dev/null grep Factbot ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Factbot ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "findlinks " | tee -a ~/webstats.tmp3 > /dev/null grep findlinks ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v findlinks ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "ia_archiver " | tee -a ~/webstats.tmp3 > /dev/null grep ia_archiver ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v ia_archiver ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Twiceler " | tee -a ~/webstats.tmp3 > /dev/null grep Twiceler ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Twiceler ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "SBIder " | tee -a ~/webstats.tmp3 > /dev/null grep SBIder ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v SBIder ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "libwww-perl " | tee -a ~/webstats.tmp3 > /dev/null grep libwww-perl ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v libwww-perl ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Powermarks " | tee -a ~/webstats.tmp3 > /dev/null grep Powermarks ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Powermarks ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Java/1.6 " | tee -a ~/webstats.tmp3 > /dev/null grep Java/1.6 ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Java/1.6 ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "WordPress " | tee -a ~/webstats.tmp3 > /dev/null grep WordPress ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v WordPress ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Gigabot " | tee -a ~/webstats.tmp3 > /dev/null grep Gigabot ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Gigabot ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Morfeus " | tee -a ~/webstats.tmp3 > /dev/null grep Morfeus ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Morfeus ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "BecomeBot " | tee -a ~/webstats.tmp3 > /dev/null grep BecomeBot ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v BecomeBot ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Sensis " | tee -a ~/webstats.tmp3 > /dev/null grep Sensis ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Sensis ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "MSOffice " | tee -a ~/webstats.tmp3 > /dev/null grep Microsoft\ Office ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v Microsoft\ Office ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "(None) " | tee -a ~/webstats.tmp3 > /dev/null grep \"-\*\"$ ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null grep -v \"-\*\"$ ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "(Other) " | tee -a ~/webstats.tmp3 > /dev/null cat ~/webstats.tmp | wc -l | tee -a ~/webstats.tmp3 > /dev/null # Sort, echo and delete counts. echo "------------------------------------------------------------------------" echo "Known bots and remaining (Other) -- Ordered by count" echo -n "------------------------------------------------------------------------" set ANS = $< sort -k2 -n -r < ~/webstats.tmp3 echo -n "" > ~/webstats.tmp3 echo "------------------------------------------------------------------------" echo "Unknown versions of known browsers. If non-zero, review the details." echo -n "------------------------------------------------------------------------" set ANS = $< cp ~/webstats.tmp ~/webstats.tmp4 echo -n "Firefox/Other " grep Firefox ~/webstats.tmp | wc -l grep -v Firefox ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "MSIE/Other " grep MSIE ~/webstats.tmp | wc -l grep -v MSIE ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo -n "Netscape/Other " grep Netscape ~/webstats.tmp | wc -l grep -v Netscape ~/webstats.tmp >! ~/webstats.tmp2 cp ~/webstats.tmp2 ~/webstats.tmp echo "------------------------------------------------------------------------" echo "Details" echo -n "------------------------------------------------------------------------" set ANS = $< less ~/webstats.tmp4 echo "------------------------------------------------------------------------" echo "Other" echo "------------------------------------------------------------------------" echo -n "(Other) " cat ~/webstats.tmp | wc -l echo "------------------------------------------------------------------------" echo "Details again. These are the leftovers." echo -n "------------------------------------------------------------------------" set ANS = $< less ~/webstats.tmp # Clean up rm ~/webstats.tmp rm ~/webstats.tmp2 rm ~/webstats.tmp3 popd