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.
I could not understand the meaning of 'INT' in the trap part of script
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)
Thanks, Connor for the explanation but I want to know the specific detail on 'INT'
Is INT and SIGINT the same?
Yes, the INT you see in the script is SIGINT, which is an "interrupt signal"
Thanks, Connor it was helpful