cd /var/www/html/FamilyHistory/search month=`date +%B` cat > index.html << EOF Photo caption search stats for $month

Photo caption search stats for $month

EOF if [ -r /tmp/query.log ] then cat >> index.html << EOF EOF sort /tmp/query.log | uniq -c | sort -nr | sed 's|^ *\([0-9]*\) *\(.*$\)||' >> index.html fi cat >> index.html << EOF
Countquery
`wc -l < /tmp/query.log`Total
\1<\/td>\2

Previous months: EOF for m in January February March April May June July August September October November December do if [ -r $m.html ] then cat >> index.html << EOF $m EOF fi done cat >> index.html << EOF
Last updated: `date +%d-%b-%Y` EOF cp index.html $month.html exit 0