Re: trap and exit status
From: Juergen Heck (btd.heck_at_t-online.de)
Date: 07/30/03
- Next message: Ben: "Re: trap and exit status"
- Previous message: Ben: "Re: Auto repeat of a command"
- In reply to: Michael Wang: "trap and exit status"
- Next in thread: Ben: "Re: trap and exit status"
- Reply: Ben: "Re: trap and exit status"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 30 Jul 2003 17:20:56 +0200
Michael Wang schrieb:
>
> 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
untested idea:
function exitfunc {
## exit-task
rc=$1
case $rc in ...
esac
}
function sigintfunc {
## sigint-task
rc=$1
case $rc in ...
esac
}
...
trap 'exitfunc $? ' EXIT
trap 'sigintfunc $? ' INT
trap ...
Regards
Juergen
- Next message: Ben: "Re: trap and exit status"
- Previous message: Ben: "Re: Auto repeat of a command"
- In reply to: Michael Wang: "trap and exit status"
- Next in thread: Ben: "Re: trap and exit status"
- Reply: Ben: "Re: trap and exit status"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|