From 268a68ae834ceed69230a383b16b16d3e09e1a5f Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sun, 13 Nov 2022 21:49:30 -0500 Subject: [PATCH] fix PIPESTATUS printing --- err | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/err b/err index 2a4077f..988678a 100644 --- a/err +++ b/err @@ -131,13 +131,13 @@ err-allow() { err-exit() { # vars have _ prefix so that we can inspect existing set vars without # too much overwriting of them. - local _err=$? _pipestatus="${_pipestatus[*]}" + local _err=$? _pipestatus="${PIPESTATUS[*]}" # This has to come before most things or vars get changed local _msg="${BASH_SOURCE[1]}:${BASH_LINENO[0]}: \`$BASH_COMMAND' returned $_err" local _cmdr="$BASH_COMMAND" # command right. we chop of the left, keep the right. - if [[ $_pipestatus != "$_err" ]]; then + if [[ $_pipestatus && $_pipestatus != "$_err" ]]; then _msg+=", PIPESTATUS: $_pipestatus" fi set +x -- 2.25.1