procmail
[Top] [All Lists]

Re: multiple action on delivered-main

2003-01-30 02:29:06
Holger Wahlen <H(_dot_)Wahlen(_at_)gmx(_dot_)de> schrieb:


dman wrote:
:0fW
* ?(echo "$FROM" | $FGREP -i -f $HOME/.procmail/spam)
| /usr/bin/formail -I "Status: R"
[...]
By the way, fgrep will become confused if $FROM starts with a
hyphen.

No, it's not seen as a command line argument, but read from standard
input (unless FGREP is set to "xargs fgrep" :-)); no problem with
leading hyphens there.

What version of fgrep are you using?  Modern fgrep implies the `-f'
already -- unless I've misunderstood something about your syntax.

I think you have: he's not telling fgrep to look for the pattern $FROM
in the file $HOME/.procmail/spam, but the other way around (with the
same result): standard input (as provided by echo) is checked for all
patterns in the file (hence -f). Your method

Okay.  Thanks, Holger.  I will have to save your post and study it
further later to bolster my grok of grep.  :-)


    * ? $FGREP -qsix -e "$FROM" some/file

is more elegant, though. (And *there* you need the -e to deal with
leading hyphens.)

Thanks.

-- 
dman


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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