Bash allows us to execute a command whenever it exits by issuing the command:
trap <script> EXIT
the atexit MBFL module uses this mechanism to register, forget and run multiple commands.
Register or delete mbfl_atexit_run()
as command for the EXIT
event. We must call this
function first if we want to use this module.
Register a new HANDLER command. If the optional argument IDVAR is present, it must be the name of a variable in the scope of the caller: store into such variable a unique identifier associated to the handler.
Remove the, previously registered, handler command associated to ID. If no handler is associated to it: nothing happens.
Run all the registered handlers, from the last registered to the first. Whenever a handler is run: it is removed from the internal registry.
Remove all the registered handlers from the internal registry. This renders invalid all the handler identifiers that were created.
This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.