From: Ian Kelling Date: Tue, 27 Sep 2016 21:44:10 +0000 (-0700) Subject: fix for bash 4.4 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=26cc217e2ab07ed64cc621289791f4d8bf716c57;p=errhandle.git fix for bash 4.4 --- diff --git a/README b/README index 2bdb934..83214bf 100644 --- a/README +++ b/README @@ -1,9 +1,9 @@ Functions to deal with errors in bash -bash-trace: print stack trace (best bash stack trace ever). -errcatch: on error, do stack trace ane exit +errcatch: set a trap on error to do bash-trace and exit errallow: undo errcatch errexit: exit and print stack trace +bash-trace: print stack trace (best bash stack trace ever) the err* functions depend on bash-trace. diff --git a/bash-trace-function b/bash-trace-function index 5c304ae..d35eb99 100644 --- a/bash-trace-function +++ b/bash-trace-function @@ -13,9 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -shopt -s extdebug +# Note: bash-trace will not show function args unless you first run: +# shopt -s extdebug +# Also note, setting extdebug in your .bashrc causes spam in bash 4.4. + bash-trace() { - # shows function args when: shopt -s extdebug local -i argc_index=0 arg frame i start=${1:-1} max_indent=8 indent local source local extdebug=false