procmail
[Top] [All Lists]

Re: Getting the MATCH

2008-07-22 10:50:22
At 17:29 2008-07-22 +0200, Dallman Ross wrote:

Sure.  I was thinking of the reverse case of your example, though,
just by way of clarification:

  echo "dman(_at_)example(_dot_)com" | fgrep -i -f blacklist

when blacklist contains feldman(_at_)example(_dot_)com, it will match.

I think you aught to re-check your assumptions there. blacklist serves as the set of patters to search against in the input stream. "feldman(_at_)example(_dot_)com" won't match into "dman(_at_)example(_dot_)com"

If instead, you were going the conventional greppage:

 fgrep -i "dman(_at_)example(_dot_)com" blacklist

where the text on the commandline is the pattern to look for in the file (or in the piped stream), then you'd have a match, because "dman(_at_)example(_dot_)com" will match into "feldman(_at_)example(_dot_)com" (unless you're specifying word delimiting, which isn't the case in the example).

Best is to have each word or phrase on its own line in the blacklist
and use the -x option to grep.

Well each word on its own line in pattern file makes sense, but the text he's piping into grep isn't one word per line. It'd be easy enough to achieve what he's looking for if the input text WERE one word per line, but then he needs to figure out just what it is he wants to word break on, because dots can't be it for email, domains, or IPs.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

____________________________________________________________
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>