procmail
[Top] [All Lists]

Re: working with variables

1999-11-22 15:34:00
Rik wrote,

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

No, sad to say I've no one to blame it on except myself and have to accept
full answerability for it.

I first thought of it to translate the three-letter month abbreviation from
the Date: header or the From_ postmark to a two-digit number, but I don't
remember whether it was for my own use or to answer a question posted here.
(Since the transitions between letters and digits were umistakable, it didn't
require the separators Rik suggested for Dallman's application, but I've
since done other things with it where separators are needed.)  It went like
this:

 monthsstring=Jan01Feb02Mar03Apr04May05Jun06Jul07Aug08Sep09Oct10Nov11Dec12

 :0 # MONTHABBREVIATION was extracted in an earlier recipe
 * $ monthsstring ?? $MONTHABBREVIATION\/..
 { MONTHNUMBER=$MATCH }

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