bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clarification needed on signal spec EXIT


From: DJ Mills
Subject: Re: Clarification needed on signal spec EXIT
Date: Tue, 16 Oct 2012 13:31:39 -0400

On Tue, Oct 16, 2012 at 1:26 PM, Francis Moreau <address@hidden> wrote:
> Hi,
>
> Currently the description of the builtin trap isn't enough regarding
> the description of the EXIT signal spec, IMHO.
>
> It says: "If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from
> the shell.", and nothing more, unless I'm missing some other points
> about it somewhere else (that would be unfortunate too).
>
> Specifically, the documentation should specify exactly what "exit from
> the shell" means: for example killing a shell process makes it exit
> somehow. Is this is supposed to be handled by EXIT signal spec ?
>
> Another thing that should be clarified is what's happening in the
> context of a subshell ?
>
> Thanks
> --
> Francis
>

Anything that causes the shell to exit will trigger the trap (with the
exception of signals that can't be handled, like KILL).
That means a normal "exit" command or hitting EOF will trigger it, but
so will TERM, or INT, etc.

What about subshells do you not understand? If the trap is defined
within a subshell, it will trigger when that subshell exits. If it's
defined outside, it will not.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]