procmail
[Top] [All Lists]

Re: using variables with Regular Expresions

2002-07-18 13:54:47
On 18 Jul, Leandro Rodrigo Saad Cruz wrote:
| Hi all.
| is it possible to use variables wit Re's ?
| e.g :
| 
| -----------------
| NAME=leandro
| :0
| * name=$NAME
| /dev/null
| -----------------
| 
|

man procmailrc

       There are some special conditions you can use that are not
       straight regular expressions.  To select them, the  condi­
       tion must start with:

       [...]

       $    Evaluate the remainder of this condition according to
            sh(1) substitution rules inside double  quotes,  skip
            leading whitespace, then reparse it.

Therefore,

NAME=leandro
:0
* $ name=$NAME
/dev/null

This is assuming you're looking for the string "name=leandro" in the
headers. If you're looking in the body, the recipe will need a "B" flag
or the conditon would need to read: * $ B ?? name=$NAME.

-- 
Reply to list please, or append "8" to "procmail" in address if you must.
Spammers' unrelenting address harvesting forces me to this...reluctantly.


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