From ee5a543e0b90b4a7a947e552cfd4d1599e76b2a1 Mon Sep 17 00:00:00 2001 From: Christoph Anton Mitterer Date: Mon, 21 Nov 2022 05:10:59 +0100 Subject: [PATCH] ssh_filter_btrbk.sh: use printf instead of echo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In spirit, POSIX considers `echo` rather obsolete (it was just kept because of its widespread use). It’s also not possible to use `echo` portably unless it’s `-n`-option (as the first argument) and escape sequences are omitted. While neither was the case here, it’s better style to just always use `printf` in order to avoid any future confusion when both are used. Signed-off-by: Christoph Anton Mitterer --- ssh_filter_btrbk.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssh_filter_btrbk.sh b/ssh_filter_btrbk.sh index 5cd9c6e..6d9c415 100755 --- a/ssh_filter_btrbk.sh +++ b/ssh_filter_btrbk.sh @@ -41,7 +41,7 @@ reject_and_die() { local reason="$1" log_cmd 'auth.err' 'btrbk REJECT' "$reason" - echo "ERROR: ssh_filter_btrbk.sh: ssh command rejected: $reason: $SSH_ORIGINAL_COMMAND" 1>&2 + printf 'ERROR: ssh_filter_btrbk.sh: ssh command rejected: %s: %s\n' "$reason" "$SSH_ORIGINAL_COMMAND" 1>&2 exit 255 } @@ -165,7 +165,7 @@ while [ "$#" -ge 1 ]; do ;; *) - echo "ERROR: ssh_filter_btrbk.sh: failed to parse command line option: $key" 1>&2 + printf 'ERROR: ssh_filter_btrbk.sh: failed to parse command line option: %s\n' "$key" 1>&2 exit 255 ;; esac