Sun 98-02-08 eristic(_at_)gryzmak(_dot_)lodz(_dot_)pdi(_dot_)net (Marek
Jedlinski) list.procmail
| BTW, I grepped the procmail manual and all the tutorials I have stashed
| away for the "$\" bit and came up with nothing :)
...It's mnentioned in the TOC of pm-tips.txt
Cheers!
jari
9.0 Variables
9.1 Setting and unsetting variables
9.2 Variable initialisation and sh syntax
9.3 Testing variables
9.4 What is construct $\VAR
9.5 Common pitfalls when using variables
9.6 Quoting: Using single or double quotes
9.7 Quoting: Passing values to a external program
9.8 Passing values from an external program
9.9 Incrementing variable by N
9.10 Comparing values
9.11 Strings: How to strip trailing newline
9.12 Strings: Getting partial matches from string
9.13 How to raise a flag if the message was filed
9.14 Dollar sign in condition line
9.15 Finding mysterious foo variable
9.16 How to OR recipes with procmail
9.17 How to OR recipes using de morgan rules
9.18 Storing code to variable
9.19 Getting headers to a variable
9.20 Converting value to lowercase
[...]
9.4 What is construct $\VAR
[era and david] Procmail 3.11, $\VAR will escape regex metacharacters
in foo. It should produce a suitably backslash-escaped expression for
Procmail's own use. In addition $\VAR will always begin with leading
empty parentheses.
You can't pass the $\VAR construct to shell programs, because there
is that leading paretheses. Here is recipe to standardize the regexp.
You can pass SAFE_REGEXP to external programs like `sed'.
PROCMAIL_REGEXP = "$\VAR"
:0
* PROCMAIL_REGEXP ?? ^^\(\)\/.*
{ SAFE_REGEXP = "$MATCH" }