From 831bb3755bd9704d690c17dede0af4d89261942f Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 28 Apr 2021 15:13:47 -0700 Subject: [PATCH] xtensa-build-zephyr: fix "die()" function It still looks smart but the \n addition compared to the original version in xtensa-build-all.sh broke it for more advanced cases: die '%s %d' str 5 -bash ERROR: -bash: printf: 5\n: invalid number As reported by shellcheck. shellcheck saves lives. In scripts/xtensa-build-zephyr.sh line 22: >&2 printf "$@\n" ^-- SC2145: Argument mixes string and array. Use * or separate argument. Signed-off-by: Marc Herbert --- scripts/xtensa-build-zephyr.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/xtensa-build-zephyr.sh b/scripts/xtensa-build-zephyr.sh index 1e9b3ea97..cf208807d 100755 --- a/scripts/xtensa-build-zephyr.sh +++ b/scripts/xtensa-build-zephyr.sh @@ -17,7 +17,8 @@ die() >&2 printf '%s ERROR: ' "$0" # We want die() to be usable exactly like printf # shellcheck disable=SC2059 - >&2 printf "$@\n" + >&2 printf "$@" + >&2 printf '\n' exit 1 }