From 2088c32977587e02d9c505e4b9221329b480ea28 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 27 May 2020 23:46:24 +0200 Subject: [PATCH] TT#82051 shellcheck fix for console_output() to expand escape sequences We are using console_output() from within log_info(), which is invoking `console_output "$*\n"`, so we need to expand the escape sequences (without interpreting other format specifiers), which is exactly what "%b" provides in bash. This is a fixup for previous commit 0dda93ad97 Change-Id: I16f354eb35e13568331e5107aff0d1c80dafb822 --- functions/logs | 4 ++-- scripts/decrypt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/functions/logs b/functions/logs index 473d4e25..85356f0e 100644 --- a/functions/logs +++ b/functions/logs @@ -8,7 +8,7 @@ export timestamp_replacementchars='' # unset by default console_output() { if [ -z "${TIME_FORMAT:-}" ] ; then - printf -- "%s" "$*" + printf -- "%b" "$*" return 0 fi @@ -18,7 +18,7 @@ console_output() { # indent depending on number of characters in date output export timestamp_replacementchars timestamp_replacementchars="$(printf -- "%s: " "$timestamp" | sed 's/./ /g')" - printf -- "%s" "$timestamp ${HNAME:-}: $*" + printf -- "%b" "${timestamp} ${HNAME:-}: $*" } # }}} diff --git a/scripts/decrypt b/scripts/decrypt index e4a67371..c6302c57 100755 --- a/scripts/decrypt +++ b/scripts/decrypt @@ -20,7 +20,7 @@ timestamp_replacementchars='' # unset by default console_output() { if [ -z "${TIME_FORMAT:-}" ] ; then - printf -- "%s" "$*" + printf -- "%b" "$*" return 0 fi @@ -29,7 +29,7 @@ console_output() { # indent depending on number of characters in date output timestamp_replacementchars="$(printf -- "%s: " "$timestamp" | sed 's/./ /g')" - printf -- "%s" "$timestamp: $*" + printf -- "%b" "$timestamp: $*" } log_info() {