05 Aug 2001

Code Red

May as well do it properly:

CONFS=$(awk '$1 ~ /^s*[Ii]nclude$/ && $2 ~ /^// {print $2}' /etc/apache/*.conf | sort -u) LOGS=$(awk '$1 ~ /^s*[A-Za-z]*Log$/ && $2 ~ /^// {print $2 "*"}' /etc/apache/*.conf $CONFS | sort -u) ; zgrep -ch default.ida $LOGS | echo $(tr 'n' '+')0 | bc

With thanks to the Debian Apache maintainer, Johnie Ingram, for the CONFS and LOGS parts (used in his
most excellent log rotating system).

But… is there a better way of doing the tr | bc bit? :) The zgrep -ch is certainly faster than using wc -l.