Concept Flow - Signal handling with trap
Start script
Set trap for signal
Run main loop or commands
Signal received?
No→Continue running
Yes
Execute trap command
Continue or exit script
The script sets a trap to catch signals, runs commands, and when a signal arrives, it runs the trap command before continuing or exiting.