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
changes/97/40297/1
Michael Prokop 6 years ago
parent 0dda93ad97
commit 2088c32977

@ -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:-}: $*"
}
# }}}

@ -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() {

Loading…
Cancel
Save