@echo off REM Tells you which browsers people were using when they found your site REM through Google searches containing a string you specify. REM Put search-uas.bat in a directory with the log files you want to analyze. REM Usage: search-uas burning\+egde REM (+ is how space appears in a Google search URL, and \ escapes the + for a grep regular expression.) REM Use Cygwin sort, not DOS sort. path=c:\cygwin\bin grep -E -i --no-filename "(google|yahoo).*%1" access* | grep -i -v browser > searches.txt sort --key=1,1 --stable searches.txt | uniq --check-chars=15 > firstsearches.txt echo Total wc -l firstsearches.txt echo IE cat firstsearches.txt | grep -i -v opera | grep -i -v khtml | grep -i -v gecko | grep -i msie | wc -l echo Gecko cat firstsearches.txt | grep -i -v opera | grep -i -v khtml | grep -i gecko | wc -l echo KHTML cat firstsearches.txt | grep -i -v opera | grep -i khtml | wc -l echo Opera cat firstsearches.txt | grep -i opera | wc -l echo Other cat firstsearches.txt | grep -i -v opera | grep -i -v khtml | grep -i -v gecko | grep -i -v msie | wc -l