From a1044d728fd0260d66461a8cb357066a7b63b6e4 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 1 Apr 2018 14:30:06 +1000 Subject: [PATCH] general: Swap echo to printf --- neofetch | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/neofetch b/neofetch index 8bebbaa6..bd1f2ccf 100755 --- a/neofetch +++ b/neofetch @@ -3263,19 +3263,10 @@ get_bold() { } 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 - # shellcheck disable=2086 - builtin echo -E ${1//[[:space:]]/ } + # shellcheck disable=2048,2086 + set -- $* + printf "%s\\n" "${*//[[:space:]]/ }" set +f }