What does bash do when it receives the SIGINT signal?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
This page says the following:
When Bash is interactive, in the absence of any traps, it ignores
SIGTERM (so that `kill 0' does not kill an interactive shell), and
SIGINT is caught and handled (so that the wait builtin is
interruptible). When Bash receives a SIGINT, it breaks out of any
executing loops.
Usually when a program receives the SIGINT
signal, the program will exit. But bash
does not exit when it receives the SIGINT
signal, instead "it breaks out of any executing loops". What does that mean?
linux bash signals
add a comment |Â
up vote
2
down vote
favorite
This page says the following:
When Bash is interactive, in the absence of any traps, it ignores
SIGTERM (so that `kill 0' does not kill an interactive shell), and
SIGINT is caught and handled (so that the wait builtin is
interruptible). When Bash receives a SIGINT, it breaks out of any
executing loops.
Usually when a program receives the SIGINT
signal, the program will exit. But bash
does not exit when it receives the SIGINT
signal, instead "it breaks out of any executing loops". What does that mean?
linux bash signals
Thatfor
andwhile
loops are broken as thoughbreak
was executed.
â Ignacio Vazquez-Abrams
Oct 28 '17 at 1:25
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
This page says the following:
When Bash is interactive, in the absence of any traps, it ignores
SIGTERM (so that `kill 0' does not kill an interactive shell), and
SIGINT is caught and handled (so that the wait builtin is
interruptible). When Bash receives a SIGINT, it breaks out of any
executing loops.
Usually when a program receives the SIGINT
signal, the program will exit. But bash
does not exit when it receives the SIGINT
signal, instead "it breaks out of any executing loops". What does that mean?
linux bash signals
This page says the following:
When Bash is interactive, in the absence of any traps, it ignores
SIGTERM (so that `kill 0' does not kill an interactive shell), and
SIGINT is caught and handled (so that the wait builtin is
interruptible). When Bash receives a SIGINT, it breaks out of any
executing loops.
Usually when a program receives the SIGINT
signal, the program will exit. But bash
does not exit when it receives the SIGINT
signal, instead "it breaks out of any executing loops". What does that mean?
linux bash signals
edited Oct 28 '17 at 2:28
Jeff Schaller
32.1k849109
32.1k849109
asked Oct 28 '17 at 1:18
Joseph
1075
1075
Thatfor
andwhile
loops are broken as thoughbreak
was executed.
â Ignacio Vazquez-Abrams
Oct 28 '17 at 1:25
add a comment |Â
Thatfor
andwhile
loops are broken as thoughbreak
was executed.
â Ignacio Vazquez-Abrams
Oct 28 '17 at 1:25
That
for
and while
loops are broken as though break
was executed.â Ignacio Vazquez-Abrams
Oct 28 '17 at 1:25
That
for
and while
loops are broken as though break
was executed.â Ignacio Vazquez-Abrams
Oct 28 '17 at 1:25
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
It means that the built-ins and loops that bash
is running at that moment are aborted. To achieve the SIGINT effect on bash
, use ^D
1
From the bash manual: "In all cases, Bash ignores SIGQUIT." Bash will interpret Ctrl-D at the start of an input line as end of input and exit, but this has nothing to do with signals.
â Johan Myréen
Oct 28 '17 at 16:59
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
It means that the built-ins and loops that bash
is running at that moment are aborted. To achieve the SIGINT effect on bash
, use ^D
1
From the bash manual: "In all cases, Bash ignores SIGQUIT." Bash will interpret Ctrl-D at the start of an input line as end of input and exit, but this has nothing to do with signals.
â Johan Myréen
Oct 28 '17 at 16:59
add a comment |Â
up vote
1
down vote
accepted
It means that the built-ins and loops that bash
is running at that moment are aborted. To achieve the SIGINT effect on bash
, use ^D
1
From the bash manual: "In all cases, Bash ignores SIGQUIT." Bash will interpret Ctrl-D at the start of an input line as end of input and exit, but this has nothing to do with signals.
â Johan Myréen
Oct 28 '17 at 16:59
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
It means that the built-ins and loops that bash
is running at that moment are aborted. To achieve the SIGINT effect on bash
, use ^D
It means that the built-ins and loops that bash
is running at that moment are aborted. To achieve the SIGINT effect on bash
, use ^D
edited Oct 28 '17 at 17:03
answered Oct 28 '17 at 7:33
xanoetux
24113
24113
1
From the bash manual: "In all cases, Bash ignores SIGQUIT." Bash will interpret Ctrl-D at the start of an input line as end of input and exit, but this has nothing to do with signals.
â Johan Myréen
Oct 28 '17 at 16:59
add a comment |Â
1
From the bash manual: "In all cases, Bash ignores SIGQUIT." Bash will interpret Ctrl-D at the start of an input line as end of input and exit, but this has nothing to do with signals.
â Johan Myréen
Oct 28 '17 at 16:59
1
1
From the bash manual: "In all cases, Bash ignores SIGQUIT." Bash will interpret Ctrl-D at the start of an input line as end of input and exit, but this has nothing to do with signals.
â Johan Myréen
Oct 28 '17 at 16:59
From the bash manual: "In all cases, Bash ignores SIGQUIT." Bash will interpret Ctrl-D at the start of an input line as end of input and exit, but this has nothing to do with signals.
â Johan Myréen
Oct 28 '17 at 16:59
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f400989%2fwhat-does-bash-do-when-it-receives-the-sigint-signal%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
That
for
andwhile
loops are broken as thoughbreak
was executed.â Ignacio Vazquez-Abrams
Oct 28 '17 at 1:25