On Sun, Jan 09, 2005 at 01:29:10PM +0100, Dallman Ross wrote:
On Sun, Jan 09, 2005 at 02:37:12AM +0100, Ruud H.G. van Tol wrote:
The -1^0 FOO ?? ^^\/. always only uses the first letter of FOO.
Let's make it also work when FOO = 'abcdefghijklmnopqrstuvwxyz'.
Good. Thanks!
Reviewing, I realize that in my tiredness late last night I didn't
think this part through as well as I thought I had. But all we
really need for my code here is to change the match condition in lop.rc
slightly.
Was:
* -1^0 FOO ?? ^^\/.
Is:
* $ -1^0 FOO ?? ^^$\BAR\/.
Full lop.rc:
:0
* $ $=^0
* $ -1^0 FOO ?? ^^$\BAR\/.
{
BAR = "$BAR$MATCH"
SWITCHRC = $_
}
Yes, it's easy enough to put it in one file with the main.rc,
as you showed and Rob mentioned. Ftr, main rc code here was:
LOP = 3 # num of chars to lop off
FOO = "abcdefghijklmnopqrstuvwxyz"
:0
* 1^1 FOO ?? .
* 1^0
* $ -$LOP^0
{ INCLUDERC = lop.rc }
FOO = "$BAR"
The reason I didn't put it in one file is, I had assumed the
main snippet would go in a general .procmailrc or other rcfile,
and not be a standalone "function." But okay, that's easy also.
Rather than make a new var to handle the "function" inside the main
file, I'd just use $BAR in this case. If it's empty/unset, this
is the first run.
:0
* $ BAR ?? $FALSE
{
# "main" goes here; but the name of the INCLUDERC becomes $_
}
:0
* $ $=^0
* $ -1^0 FOO ?? ^^$\BAR\/.
{
BAR = "$BAR$MATCH"
SWITCHRC = $_
}
FOO = "$BAR"
---
dman (should remember not to post code created after 1 a.m.)
____________________________________________________________
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