14 Aug 2008 16:03
Re: Which grep match?
Scott Moseman <scmoseman <at> gmail.com>
2008-08-14 14:03:15 GMT
2008-08-14 14:03:15 GMT
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.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 >
RSS Feed