help-bash
[Top][All Lists]
Advanced

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

SIGQUIT in subshell


From: Maksym Telychko
Subject: SIGQUIT in subshell
Date: Wed, 15 Jul 2026 14:41:43 -0700

Hello,

I have a question about processing SIGQUIT signal in the subshell.

Why the "original" state for  SIGQUIT in subshell is considered as
"core dump", but not ignored as in non-subshell. I guess, it a little
bit confusing.

There is extract from bash manual related to the question.

Signals clause of bash manual claims that:
     ...  In all cases, bash ignores SIGQUIT. ...

Manual for the trap command says:
            Trapped signals that are not being ignored are reset to
their original values in a subshell or subshell environment when one
is created.

Script for testing:
        #!/bin/bash
        (
            sleep inf
            echo OK
        )
        echo END

When you press Ctrl+\, you will see END. But if subshell would also
ignore SIGQUIT, it also could print OK.

Thank you.



reply via email to

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