Bash script run with timeout won't exit on SIGINT Bash script run with timeout won't exit on SIGINT shell shell

Bash script run with timeout won't exit on SIGINT


The issue is with the timeout command, that makes your script immune to Ctrl+C invocation. Since by default timeout runs in its own process group and not in the foreground process group, it is immune to the signals invoked from an interactive terminal.

You can run it with --foreground to accept signals from an interactive shell. See timeout Man page