procmail
[Top] [All Lists]

RE: Can variables be nested?

2004-05-24 11:37:38


-----Original Message-----
From: procmail-bounces(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
[mailto:procmail-bounces(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE]On Behalf Of 
Jim Osborn
Sent: Saturday, May 22, 2004 2:22 PM
To: procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
Subject: Can variables be nested?


I'd like to assemble sets of ORed words, which I have assigned to
variables, into yet other sets of variables.  That is, I end up
with variables containing other variables.  So far, I haven't been
able to get procmail to recognize the nested vars.


Jim,

Although not completely general, I think you can add extra $'s to
the line where you want variables to be successively expanded.
For example,

LOGFILE=$HOME/p.log
NL="
"
DEFAULT=|
SENDMAIL=""
VERBOSE=yes
 
V1='c${A}t'
A='a'

### Note the double $-signs below, forcing re-evaluation.
:0
* $$ B ?? "$V1"
match.mbox

----

produces the following log (with "cat" in the message body):

procmail: Assigning "V1=c${A}t"
procmail: Assigning "A=a"
procmail: Match on "cat"
procmail: Assigning "LASTFOLDER=match.mbox"
procmail: Opening "match.mbox"
procmail: Acquiring kernel-lock
From gary(_at_)intrepid(_dot_)com  Sat May 22 11:45:17 2004
 Subject: test message
  Folder: match.mbox                                             


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