procmail
[Top] [All Lists]

Re: working with variables

1999-11-22 14:20:32
Howzabout:

 DOMAIN=maindomain.com
 :0
 * DOM ?? sat\/[1-5]
 { DOMAIN=satellite$MATCH.com }

They're not really named that, and don't really have numbers.  That
was just for illustration.  ;-)

But this is getting close.

Can I say "if $DOM = sat1 then domain = tldrealname.com" somehow?

Sure.

 DOMAIN=default.value.com
 lookUpTable=" input1:output1 input2:output2 input3:output3 "
 :0
 * $ lookUpTable ?? () $DOM:\/[^ ]+
 { DOMAIn=$MATCH.com }


The lookUpTable trick is something I picked up from David Tamkin,
who may or may not have picked it up from someone else in turn. Very
useful in many situations. The () in the condition line guards a
significant space in the pattern. Without it, the pattern doesn't
start until $lookuptable. The parens could contain the space instead
of precede it with the same result

-- 
Rik Kabel          Old enough to be an adult              
rik(_at_)netcom(_dot_)com

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