From 45f2d4ba38852b611bc4bf622b2582de85b0ab91 Mon Sep 17 00:00:00 2001 From: Kent Gibson Date: Mon, 3 Jun 2024 19:56:25 +0800 Subject: [PATCH] tools: tests: don't use variables in printf format string Fix shellcheck SC2059[1] - don't use variables in the printf format string. [1] https://www.shellcheck.net/wiki/SC2059 Signed-off-by: Kent Gibson Link: https://lore.kernel.org/r/20240603115628.102616-6-warthog618@gmail.com Signed-off-by: Bartosz Golaszewski --- tools/gpio-tools-test.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gpio-tools-test.bash b/tools/gpio-tools-test.bash index efe558b..d9930f1 100755 --- a/tools/gpio-tools-test.bash +++ b/tools/gpio-tools-test.bash @@ -3048,7 +3048,7 @@ die() { oneTimeSetUp() { test "$SHUNIT_VERSION" = "$MIN_SHUNIT_VERSION" && return 0 local FIRST - FIRST=$(printf "$SHUNIT_VERSION\n$MIN_SHUNIT_VERSION\n" | sort -Vr | head -1) + FIRST=$(printf "%s\n%s\n" "$SHUNIT_VERSION" "$MIN_SHUNIT_VERSION" | sort -Vr | head -1) test "$FIRST" = "$MIN_SHUNIT_VERSION" && \ die "minimum shunit version required is $MIN_SHUNIT_VERSION (current version is $SHUNIT_VERSION" } @@ -3058,7 +3058,7 @@ check_kernel() { local CURRENT CURRENT=$(uname -r) - SORTED=$(printf "$REQUIRED\n$CURRENT" | sort -V | head -n 1) + SORTED=$(printf "%s\n%s" "$REQUIRED" "$CURRENT" | sort -V | head -n 1) if [ "$SORTED" != "$REQUIRED" ] then -- 2.30.2