Date: Wed, 23 Mar 2005 12:29:02 -0600 (CST) From: "Brian John" <brianjohn@fusemail.com> To: freebsd-questions@freebsd.org Subject: Simple bash script to grep files for bad keywords Message-ID: <4742.209.87.176.4.1111602542.fusewebmail-19592@webmail.fusemail.com>
index | next in thread | raw e-mail
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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4742.209.87.176.4.1111602542.fusewebmail-19592>
