gaboshlib/g_traceback.sh aktualisiert

This commit is contained in:
olli 2023-11-07 10:18:57 +01:00
parent 001c61d17d
commit 44b9f98ed2

View File

@ -1,11 +1,10 @@
function g_traceback { function g_traceback {
local deptn=${#FUNCNAME[@]} local deptn=${#FUNCNAME[@]}
for ((i=1; i<$deptn; i++)); do for ((i=1; i<$deptn; i++)); do
local func="${FUNCNAME[$i]}" local func="${FUNCNAME[$i]}"
local line="${BASH_LINENO[$((i-1))]}" local line="${BASH_LINENO[$((i-1))]}"
local src="${BASH_SOURCE[$((i-1))]}" local src="${BASH_SOURCE[$((i-1))]}"
printf '%*s' $i '' # indent printf '%*s' $i '' # indent
echo "at: $func(), $src, line $line" echo "at: $func, $src, line $line" 1>&2
done done
} }