We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
echo -e
printf
1 parent 03b7856 commit 1f17079Copy full SHA for 1f17079
lib/bashly/libraries/stacktrace/stacktrace.sh
@@ -17,11 +17,11 @@ stacktrace() {
17
local i=0
18
local caller_output line func file
19
20
- echo "${BASH_SOURCE[0]}:${BASH_LINENO[0]} in \`${FUNCNAME[1]}\`: $BASH_COMMAND"
21
- echo "Stack trace:"
+ printf "%s:%s in \`%s\`: %s\n" "${BASH_SOURCE[0]}" "${BASH_LINENO[0]}" "${FUNCNAME[1]}" "$BASH_COMMAND"
+ printf "\nStack trace:\n"
22
while caller_output="$(caller $i)"; do
23
read -r line func file <<< "$caller_output"
24
- echo -e "\tfrom ${file}:${line} in \`$func\`"
+ printf "\tfrom %s:%s in \`%s\`\n" "$file" "$line" "$func"
25
i=$((i + 1))
26
done
27
exit 1
0 commit comments