[PLUG] Using variables for procmail matches

Sandy Herring sandy at herring.org
Fri Jan 7 01:25:39 UTC 2005


On Thu, 06 Jan 2005, Bill Thoen wrote: 
> On Thu, 6 Jan 2005, Sandy Herring wrote:
> 
> > :0:
> > * 1^0 HB ?? p(i|1|j|l|:|!|\|)lls
> > TESTFOLDER
> > 
> > should work.
> 
> Yes, but I must not be making myself clear. This works too, no problem:
> :0:
> * 1^0 HB ?? p[i1jl:\!|]lls
> TESTFOLDER
> 
> But I don't want it hard-coded. I'm hoping there's a way that I can use a 
> varialble for alternate character expressions in square brackets.
> Is it possible to set a variable that can be expanded in the match 
> expression? Something like the following?

Okay. Try...

I_='(i|1|j|l|:|!|\|)'
PILL_="P($I_)ll(s)?"
:0:
* 1^0 HB ?? $PILL_
TESTFOLDER
 
> MYVAR=[ilj1:]
> :0:
> * 1^0 HB ?? p${MYVAR}lls
> TESTFOLDER
> 
> In reality, the definition of MYVAR will be at the top of a long recipe
> and I have several words I'm looking for that need to make one or more
> tests for alternate spellings of 'i'.
> 
> > You'll find plenty of online resources that are somewhat less cryptic
> > than the `man' pages. Here's a start...
> > 
> > http://www.herring.org/techie.html#procmail
> 
> Thanks! I'll check it out directly.

You're welcome. pm.tips is one of the better resources.

cheers,
Sandy
-- 
Sandy Herring, RHCE                        o              sandy at herring.org
Peck of Pickled Pisces               __  o               http://herring.org/
*nix || Web authoring questions?  |\/ o\  o  http://herring.org/finger.html
->http://herring.org/techie.html  |/\__/     http://herring.org/pub-key.asc



More information about the PLUG mailing list