Skip to content

Files

Latest commit

0ed4f47 · May 22, 2024

History

History
27 lines (15 loc) · 628 Bytes

README.md

File metadata and controls

27 lines (15 loc) · 628 Bytes

trap.sh

Library for managing bash signal traps.

Contents

Installation

See the latest release for instructions.

Usage

trap_prepend CMD SIGNAL

Prepends CMD to the SIGNAL trap. $TRAP_POINTER will contain a pointer that can be used with trap_remove to remove the command again.

trap_append CMD SIGNAL

Appends CMD to the SIGNAL trap. Works just like trap_prepend otherwise.

trap_remove POINTER

Removes the command identified by POINTER from the list of traps to run.