Re: A defer command as a bash loadable builtin
Gregory Heytings <[email protected]> Wed, 24 Jun 2026 22:36:09 +0000
| Newsgroups | gmane.comp.shells.bash.bugs |
|---|---|
| Message-ID | <[email protected]> |
>
> I implemented defer as a bash loadable builtin.
>
> It is a wrapper over the trap builtin that chains handlers on signals
> instead of replacing them (LIFO order):
>
> https://github.com/leagris/bash-loadable-defer
>
Is this better than
trap_append () { trap "$(printf "%s\n$1" "$(trap -P "$2")")" "$2"; }
trap_prepend () { trap "$(printf "$1\n%s" "$(trap -P "$2")")" "$2"; }
?