Commit a1044d72 authored by Dylan Araps's avatar Dylan Araps

general: Swap echo to printf

parent 81db772a
...@@ -3263,19 +3263,10 @@ get_bold() { ...@@ -3263,19 +3263,10 @@ get_bold() {
} }
trim() { trim() {
# When a string is passed to "echo" all trailing and leading
# whitespace is removed and inside the string multiple spaces are
# condensed into single spaces.
#
# The "set -f/+f" is here so that "echo" doesn't cause any expansion
# of special characters.
#
# The whitespace trim doesn't work with multiline strings so we use
# "${1//[[:space:]]/ }" to remove newlines before we trim the whitespace.
set -f set -f
# shellcheck disable=2086 # shellcheck disable=2048,2086
builtin echo -E ${1//[[:space:]]/ } set -- $*
printf "%s\\n" "${*//[[:space:]]/ }"
set +f set +f
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment