Re: trap and exit status

From: Michael Wang (mwang_at_unixlabplus.com)
Date: 07/29/03


Date: Tue, 29 Jul 2003 17:43:07 GMT

In article <3F26AACE.9E221D42@ChironComputing.Com>,
scriptOmatic <ScriptOmatic@OpenSysMon.Com> wrote:
>Michael Wang wrote:
>>
>> I wonder if there is a solution in ksh (88 or 93) for following spec:
>>
>> - setup exit and signal trap
>> - retain the exit status as if no trap was set (exit status-128 or 256 is ok)
>> - differentiate exit and signal trap, as they will perform different tasks
>>
>> Thanks.
>> --
>> Michael Wang * http://www.unixlabplus.com/ * mwang@unixlabplus.com
>
>see the file "new" at ftp.opensysmon.com/pub/scripts/new.*
>there is a zip file

SIGINT=2
trap "Exit ${SIGINT};" ${SIGHUP} ${SIGINT} ${SIGTERM}

did not satisfy the spec "retain the exit status as if no trap was set".

-- 
Michael Wang * http://www.unixlabplus.com/ * mwang@unixlabplus.com


Relevant Pages

  • Re: Computability in principle
    ... > I was arguing against Joe Marshall's claim that "a specification formal ... The spec gives a mapping from programs to one of three ... won't work if there are can be no examples that satisfy the spec. ... If you put resource restrictions on the program, however, you should ...
    (comp.lang.lisp)
  • Re: Boot Up Problem
    ... Try going into the cmos and just save and exit out, this might satisfy it. ... > the drive worked perfectly and I used it to backup some critical files. ...
    (microsoft.public.windowsxp.basics)
  • Re: Delete all files from a directory but leave subdirectories
    ... > I was wondering if I can get rid of this message and protect myself ... >against an instance where someone will aliase rm to rm -r. ... the following will satisfy your spec: ...
    (comp.unix.shell)