I have a log file that exists in multiple directories one for each client.  I am trying to run the following:find . -iname 20140926.log -exec cat {} \; | grep 123456 | grep 'food=100' | wc -lthis returns me the result I want but I want to know for each fullpath what the individual count was. For example I tried this:for f in /path/*; do  result=`eval grep 123456 $f/logs/20140926.log | grep 'food=100' | wc -l`  echo $f - $result doneBut it just returning a list of all my directories and then the final result. I am expecting something like this:/path1/log/file.log - 0/path2/log/file.log - 2/path3/log/file.log - 39etc...This way I can see the wc for my grep for each path/file  
run grep cmd recursively and print path name and result
shell script;grep;find
grep -H will print file names for you, but since you're doing multiple greps you can just echo the file name yourself:for f in $(find . -name '20140926.log'); do    echo -n $f     grep 123456 $f | grep -c 'food=100'   # grep -c prints count of matchesdone