Simple bash script to grep files for bad keywords

Brian John brianjohn at fusemail.com
Wed Mar 23 10:29:11 PST 2005


Hello,
I am trying to write a simple bash script that will grep all files in a
directory (except ones that start with "00") for certain bad keywords. 
Here is what I have so far:
#!/bin/bash

# This is a simple script to check all sql scripts for bad keywords

BAD_KEYWORDS='spool echo timing commit rollback'

for i in $BAD_KEYWORDS;
do
      echo "*********************************";
        echo "GREPing for bad keyword '$i'"
        echo "*********************************";
        grep $i ./*;
done

However, I'm not sure how to make it not grep the files that start with
"00".  Can anyone help me with this?

Thanks

/Brian


More information about the freebsd-questions mailing list