Re: Shutdown function



Yes I want to use it in CLI, but I want only to catch exit status in
sutdown function. Any other idea is not acceptable. I cannot rebuild
code to use return statements.
There is one more thing that i'd like to ask. Lets tell that there is
some Parse error in script (error_handler doesn't catch it) how to get
know in shutdown function that this error occured.
I just want to know if script ends correctly or not (if there were
some critical errors or if there were some exits with codes different
then 0)

Anyway, thanks for Your reply.

On 22 Gru, 15:50, FutureShock <futuresho...@xxxxxxx> wrote:
phenom...@xxxxxxxxx wrote:
Is it possible to get exit status in shutdown function. For example if
I call exit(1), How to get in shutdown functino that exit status was 1.

I think only if you are using a command line access because the script
will die on the server so there will be no means of accessing that
'with' the script.

You can however use a string "exit("there has been an error");, this is
output by the server and NOT the script

But be careful at what you output, I don't think you can turn off this
output. So whatever you put in as a string will output no matter your
error settings.  Someone correct me on this if I am wrong.

You  may want to review your code logic and maybe use a different
capture method such as "return 'some_value'";

Just a thought though.

Scotty

.



Relevant Pages

  • Re: Session problem
    ... it was a leftover from various test i've made before ... Also i forgot to mention that on a server with php5 it was working ... I've put exit after the header. ... otherwhise the execution of the script is not stopped. ...
    (comp.lang.php)
  • Re: Problem signing on to AIM with Net::AOLIM
    ... What do you mean 'post real code'? ... Of course it's not needed but an exit statement at the of a Perl script does no harm and it makes clear to the reader the point at which the main part of the code ends. ... I am able to telnet to the AOL login server port and it responds so it's not a firewall problem. ...
    (comp.lang.perl.misc)
  • Re: Remove duplicate files [POSIX script]
    ... I added in a hurry before I posted the script. ... In addition to the algorithmic complexity one should also note that ...
    (comp.unix.shell)
  • Re: Changing a users password non-interactively?
    ... You need expect and a setpass.expect script which ill add ... exit with a nasty warning. ... # Be careful of the COMMAND and UNDOCMD - they are dependant on your ...
    (comp.unix.aix)
  • Re: script does not always work the same each time.
    ... I have written a simple script to test code build and test run on a ... $lineterminationChar {append output $expect_out; ... exit 1;} ...
    (comp.lang.tcl)