Glossary term
What is trap? Meaning for developers
A rule that says when a signal or event happens, run this command, often used for cleanup.
Learn it properly · Linux & ShellLesson 4: Shell Scripting: Variables, Conditions, Loops and FunctionsWriting safe bash scripts: quoting, set -euo pipefail, arguments, conditions, loops, functions, trap, and ShellCheck.