Skip to content

Commit 1f17079

Browse files
committed
change echo -e to printf
1 parent 03b7856 commit 1f17079

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/bashly/libraries/stacktrace/stacktrace.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ stacktrace() {
1717
local i=0
1818
local caller_output line func file
1919

20-
echo "${BASH_SOURCE[0]}:${BASH_LINENO[0]} in \`${FUNCNAME[1]}\`: $BASH_COMMAND"
21-
echo "Stack trace:"
20+
printf "%s:%s in \`%s\`: %s\n" "${BASH_SOURCE[0]}" "${BASH_LINENO[0]}" "${FUNCNAME[1]}" "$BASH_COMMAND"
21+
printf "\nStack trace:\n"
2222
while caller_output="$(caller $i)"; do
2323
read -r line func file <<< "$caller_output"
24-
echo -e "\tfrom ${file}:${line} in \`$func\`"
24+
printf "\tfrom %s:%s in \`%s\`\n" "$file" "$line" "$func"
2525
i=$((i + 1))
2626
done
2727
exit 1

0 commit comments

Comments
 (0)