On Fri, Jul 10, 2009 at 10:34 PM, Glen Johnson<[email protected]> wrote:
> Something that will search a file for a string, if the string is found,
> output the name of the file to a text file.
grep -l pattern filespec
For example:
grep -l -i viagra d:\mail\outgoing\*
The -i means "case insensitive".
grep comes from Unix. Microsoft has a suite of Unix tools for
Windows. It used to be called "Services For Unix"; I think they
changed the name. It's free now. Alternatively,
<http://unxutils.sf.net/> has it (also free).
If you fire up a Unix shell (sh.exe from UnxUtils, or whatever),
then you can do a neat pipeline:
mv $( grep -l -i viagra d:/mail/outgoing/*) d:/mail/junk
(The slashes for directories go the other way in Unix.)
-- Ben
~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~