Provides frequently used functions in shell scripts.
Donwload shell functions:
curl -O https://github.com/ergomentum/shell-functions/blob/master/common_functions.sh
Include shell functions:
# shellcheck disable=SC1091
source common_functions.sh
traps
allow to build a stack of commands, run when the script exits. The command last registered via traps
will be
run first. If you want a Maven style execution summary with success or failure message,
register the exit_trap
as first trap.
# Prints a Maven style execution summary (must be registered first)
traps exit_trap EXIT
# Will be run before the execution summary:
traps "echo outer" EXIT
# Will be run first:
traps "echo inner" EXIT
To contribute a feature or a bugfix please open a pull request on GitHub.
See CONTRIBUTING for details.
See the LICENSE file for license rights and limitations (Apache License, Version 2.0).