gaboshlib/traceback.sh hinzugefügt

This commit is contained in:
olli 2023-11-06 21:04:55 +01:00
parent bf4c178ea0
commit 0232c89ede

11
gaboshlib/traceback.sh Normal file
View File

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