procmail
[Top] [All Lists]

Re: multiply by -1

2005-07-07 02:35:18
On Wed, Jul 06, 2005 at 10:13:28PM -0700, Gary Funck wrote:

boring but effective:

VAR="-$VAR"
:0
* VAR ?? ^--\/.*
{
VAR=$MATCH
}

Yes, these kinds of tests are always possible, but I was
looking for the shmancier approach.

One could also do this, which I had at first:


   :0
   * $ $VAR^0
   { VAR = -$VAR }

   :0 E
   * VAR ?? ()\/[0-9]+
   { VAR = $MATCH }


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>