procmail
[Top] [All Lists]

Re: multiply by -1

2005-07-07 02:29:54
On Wed, Jul 06, 2005 at 07:39:49PM -0500, David W. Tamkin wrote:

Dallman,

What's a good method of getting an an inverse value
for an unknown digit?

We've been through it before:

  $ $VAR^-2 HOST ?? ^^.|.^^

subtracts $VAR from the score, assuming $HOST is at least two
characters long.

Right-o.  Thanks, David.  After my memory failed and the list
archive search did as well, and after I posted, I got pretty
close reconstructing it.  I'm a bit weak on the odd x-value
manipulations in a "w ^ x" scoring statement, though, so
was glad for the push.

I wonder if HOST could ever be one char long.  I was going to say
that a value that's there in modern procmail that's usually shorter
than HOST and always at least two (three) could be LINEBUF.
However, one can reset it to zero; while, as you know,
resetting the host will end the procmail session.

Btw, when one resets LINEBUF to zero, I suspect it's not really the
line buffer that's being reset to zero, but maybe a virutal pointer
to it or something.  I don't know, but other assignments still work
after such a reassignment statement.  Also, I believe even procmail
3.10, which has no LINEBUF var set out of the box, has an internal
line buffer (of, I think, 256 bytes).


Next question: what's an elegant way to look up TZ info from
alphabetical designations?  I know they're on the system somewhere.
This is going to require a shell fork, unless one wants to
set up a massive look-up table in procmail, which I don't
for this purpose.  Anyway, it's pretty rare for the numerical
timezone offset not to be there at all.  I've seen one such
message in one legit Received header in the last week of
looking.  (It said only "EEST" for the offset.)

Okay, so now some of you have guessed why I wanted to do this math.  :-)


Dallman

____________________________________________________________
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

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