April 15, 2004

I don't know why I couldn't find one out there, but anyway... pipe a find to it to operate over a directory structure: #!/bin/bash fname=start count=0 total=0 echo "getfile" while [ "$fname" != "" ] do read fname if [ -f $fname ] then count=`grep -v --count xyzzy $fname` echo "$fname = $count" let "total=total + count" fi done echo "total= $total"

No comments: