procmail
[Top] [All Lists]

Re: Which grep match?

2008-08-14 09:05:19
grep -o

I read about that previously on the man page but for some reason
discounted what it was suppose to do, thinking it was not my
intention.  But it appears to do exactly what I'm interested in having
done (at least for grep and fgrep queries, not egrep, but that's fine
for now).

Thanks,
Scott


On Wed, Aug 13, 2008 at 3:53 PM, Scott Moseman <scmoseman(_at_)gmail(_dot_)com> 
wrote:

Let's start from this very basic grep recipe...

* ? formail -x Subject: | fgrep -is -f /etc/procmail/subjects.txt

I will know it matched an entry in the file, but I will not know
*which* entry (from subjects.txt) was matched.  Is there an *easy* way
to process this type of query *and* get the match output?  I suppose
in a worst case I could pipe to a script and go through the
subjects.txt file line by line looking for a match, but there must be
an easier way?

My goal is that I desire to start collecting a "hit count" on the
matches, so I see which ones are matched often and which ones are
rarely matched, if ever.

Thanks,
Scott

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>