Linux

What is a trap?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

A trap is a mechanism that allows the shell to intercept signals sent to a process and perform a specific action, such as handling errors or cleaning up resources before terminating the process.