procmail
[Top] [All Lists]

RE: Can These 2 Recipes Be Or'd?

2004-05-10 10:34:24
From: David W. Tamkin

Clever, Dallman.

 DRYRUN = -0.00001             # de minimus negative decimal number

Wouldn't -1 do just as well?

Yes, certainly.  I should have mentioned that I use the
very small negative number for other things, too, that I
also call $DRYRUN.  So here it was simple to just plug in
my existing definition.  But, yes, any negative number
(that's nowhere near procmail's "minus infinity") is fine,
as you understood.


More generally:

 DRYRUN = -0.00001           # de minimus negative decimal number
 ALIST   = "choco:vanilla"   # a list that will be reparsed
 :0
 * $  $DRYRUN^0  ALIST ?? ^^\/[^:]+
 * 9876543210^0  one condition
 * $  $DRYRUN^0  ALIST ?? :\/.+^^
 * 9876543210^0  alternative condition
 $MATCH

The limitation is that the various desired actions must be 
all saves to folders or all writes to commands; you can't 
have some of both.  Also, the same colon-line flags must 
apply to both or all possible evaluations of the action line.

Yes, again.[1]  Well said.

[1] Hmm, but I can think of a way to have different types of
actions, too!  That is, if we allow fake actions via "?" conditions.
Example:

  DRYRUN = -1             # some negative number
  MYACTION_LST = ':foo:gzip -fc9 >> bar.gz:$SENDMAIL $SENDMAILFLAGS
me(_at_)elsewhere(_dot_)com'
  MATCH
  :0:
  * $  $DRYRUN^0  MYACTION_LST ?? $\MATCH:\/[^:]+
  * 9876543210^0  condition
  * $  $DRYRUN^0  MYACTION_LST ?? $\MATCH:\/[^:]+
  * 9876543210^0  alternative condition
  * $  $DRYRUN^0  MYACTION_LST ?? $\MATCH:\/[^:]+
  * 9876543210^0  third alternative condition
  * $ ? "$MATCH"
  { }
  :0 E:
  $MATCH

In this example, we sometimes end up with a useless lockfile;
and if saving to a file ("foo", the first item in the list),
we actually do the save in the second, else, recipe.  But
it was fun to create this.  :-)


Dallman


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