From bash manual
When Bash receives a SIGINT, it breaks out of any executing loops.
When receiving SIGINT, does bash also quit other commands, besides loops (for or while)? Thanks.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Quoting the bash manual:
bashis interactive, in the absence of any traps, it ignores
kill 0does not kill an interactive shell), and
SIGINTis caught and handled (so that the
waitbuiltin is interruptible).
Yes, bash quits builtins when it receives
SIGINT. You can verify that with
read from a large file with no newlines will give you time to press CtrlC).
wait in particular needs to deal with
SIGINT correctly, as per POSIX (along with all other signals it can come across).