~/ learn/ comp-325/ cards/ Ignoring, catching, and cleaning up
1 of 8

The three dispositions, then a listing

The three dispositions, then a listing

Answer

trap 'echo caught; exit 1' INT trap '' INT trap - INT trap

Catch, ignore, restore the default, then print the traps currently set. Bare trap resets nothing — it reports.

S&K 3e ch13 §13.4; trap semantics and signal names from POSIX.1-2024 (trap, signal.h)

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/ee4c85a1-06c2-44dd-87ea-a33d70722625/flashcard utf-8 LF