procmail
[Top] [All Lists]

Re: capture exitcodes

2002-11-15 07:55:58
Philip Guenther wrote:
Tom Allison <tallison(_at_)tacocat(_dot_)net> writes:

I have an application that I want to use as a filter
but I also need to capture the exit code.

...

I can do:

:0 fw:
| foo-script
EXITCODE = $=


1) Don't use the variable 'EXITCODE' unless you want to affect the exit
   status of procmail itself.

2) The exit status of the last program executed by procmail is found in
   $?.  $= is the score of the last recipe.

3) Do you really need a locallockfile on that recipe?  Can only one copy
   of foo-script be running at any given moment?



What I need to do next is if EXITCODE <> 0, HALT.


        :0 fw:
        | foo-script

        status = $?


I guess I'm really stuck...

I have a perl script which specifically calls "exit 75;"
I know it's doing this.
There is also an END{ } to this same script, so I guess that gets executed too.

But every time, procmail says EXITCODE = 0

I got this to work once by setting X-Headers and looking for them because I was _never_ able to get any exitcode stuff to work correctly.

Event this fails:

:0f
| foo.pl

EXITCODE = $=

Where foo.pl is:

#!/usr/bin/perl
exit 75;


I still et exitcode = 0
--
The kind of danger people most enjoy is the kind they can watch from
a safe place.


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