Concept Flow - trap for cleanup on exit
Start Script
Set trap for EXIT
Run main commands
Script ends or interrupted
Trap triggers cleanup function
Cleanup actions run
Exit script
The script sets a trap to run cleanup code when it exits normally or is interrupted.