~/ 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/80ab1d6d-d560-4b08-9205-d289d0d20c1f/flashcard utf-8 LF