I'm trying to write a shell script that accepts a pattern and any number of file names and then counts the number of occurrences of the pattern in the listed files. A pattern can occur more than once on the same line. The only return value is one number that is the number of times the pattern occurs in all the files. I was wondering if anyone had any tips on how to do write this script. Thanks.