DEV Community

Discussion on: Running (and killing) multiple processes in a single shell script

Collapse
 
connorbode profile image
Connor Bode

I'll explain what I know but I dont have a very deep understanding here (maybe someone else can jump in with more info).

When you hit ctrl-c you send a SIGINT to the script running in your terminal. It's called a "signal" and SIGINT is one of many signals that exist on unix systems.

Think of it like an event that occurs. A "trap" is just an event handler for a signal.

Here's some additional reading on signals: en.m.wikipedia.org/wiki/Signal_(IPC)

Collapse
 
coolvikas profile image
Vikas Kumar

Thanks, Connor for the explanation but I want to know the specific detail on 'INT'
Is INT and SIGINT the same?

Thread Thread
 
connorbode profile image
Connor Bode

Yes, the INT you see in the script is SIGINT, which is an "interrupt signal"

Thread Thread
 
coolvikas profile image
Vikas Kumar

Thanks, Connor it was helpful