Skip to content

Instantly share code, notes, and snippets.

@baepiff
Created February 5, 2013 04:42
fixed bash shell
#!/bin/sh
ls /usr/local/tomcat/logs/logs.log.2013-*-*.gz > ./targetlist.txt
exec 0<./targetlist.txt
count=0
while read line; do
temp=`zgrep -c -E -i -w 'target1|target2' $line`
count=$(($count + $temp))
echo "$count"
done
echo "$count"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment