What does bash do when it receives the SIGINT signal?

The name of the pictureThe name of the pictureThe name of the pictureClash 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?







share|improve this question






















  • That for and while loops are broken as though break was executed.
    – Ignacio Vazquez-Abrams
    Oct 28 '17 at 1:25














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?







share|improve this question






















  • That for and while loops are broken as though break was executed.
    – Ignacio Vazquez-Abrams
    Oct 28 '17 at 1:25












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?







share|improve this question














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?









share|improve this question













share|improve this question




share|improve this question








edited Oct 28 '17 at 2:28









Jeff Schaller

32.1k849109




32.1k849109










asked Oct 28 '17 at 1:18









Joseph

1075




1075











  • 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















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










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






share|improve this answer


















  • 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











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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






























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






share|improve this answer


















  • 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















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






share|improve this answer


















  • 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













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






share|improve this answer














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







share|improve this answer














share|improve this answer



share|improve this answer








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













  • 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


















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay