Replace $_ in error trap (#1776)

This commit is contained in:
Casper 2021-01-28 14:50:28 +01:00 committed by GitHub
parent 7fd6751e89
commit 70267d89e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -121,7 +121,7 @@ A construct to trace error in your scripts looks like this. Remember: Remove `se
``` BASH
set -xeuEo pipefail
trap '__log_err ${FUNCNAME[0]:-"?"} ${_:-"?"} ${LINENO:-"?"} ${?:-"?"}' ERR
trap '__log_err ${FUNCNAME[0]:-"?"} ${BASH_COMMAND:-"?"} ${LINENO:-"?"} ${?:-"?"}' ERR
SCRIPT='name_of_this_script.sh'

View file

@ -7,7 +7,7 @@
SCRIPT='setup.sh'
set -euEo pipefail
trap '__log_err ${FUNCNAME[0]:-"?"} ${_:-"?"} ${LINENO:-"?"} ${?:-"?"}' ERR
trap '__log_err ${FUNCNAME[0]:-"?"} ${BASH_COMMAND:-"?"} ${LINENO:-"?"} ${?:-"?"}' ERR
trap '_unset_vars || :' EXIT
function __log_err

View file

@ -24,7 +24,7 @@ _get_current_directory
# ? ERRORS
set -eEuo pipefail
trap '__log_err ${FUNCNAME[0]:-"?"} ${_:-"?"} ${LINENO:-"?"} ${?:-"?"}' ERR
trap '__log_err ${FUNCNAME[0]:-"?"} ${BASH_COMMAND:-"?"} ${LINENO:-"?"} ${?:-"?"}' ERR
function __log_err
{