procmail
[Top] [All Lists]

Re: exit codes, TRAP, etc.

2004-04-14 17:53:15
Toen wij Dallman Ross kietelden, kwam er dit uit:

I cannot find a simple way to see if
an INCLUDERC didn't execute, other than testing for something
that could only have happened inside the INCLUDERC.

What's wrong with that then?

Inside the INCLUDERC put something like 

  RCSIG = $_
  :0
  * RCSIG ?? ()\/[^/]+^^
  { RCSIG = $MATCH }
  G_WASHERE = "${G_WASHERE}${RCSIG}$NL"


If you also want to POP easily from G_WASHERE, 
you need to either save it before the INCLUDERC 
so that you can restore the previous value, or 
use a specific start-character per level, like 
the letters of the alphabets.

# a global variable
  G_LEVEL = "@"
# a constant
  C_ALPHA = "@\
ABCDEFGHIJKLMNOPQRSTUVWXYZ\
abcdefghijklmnopqrstuvwxyz"

  :0D
  *$ C_ALPHA ?? $G_LEVEL\/.
  { G_LEVEL = $MATCH }  # now G_LEVEL = A

and replace the last line of the previous code with
  G_WASHERE = "${G_WASHERE}${G_LEVEL}:${RCSIG}$NL"

-- 
Grtz, Ruud

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