From 42a94d79639dfc27899fe094754d10e9ea868ddf Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Mon, 29 Sep 2025 22:47:41 +0100 Subject: [PATCH] Fix error SC2068 in shell scripts Fix SC2068 (error): Double quote array expansions to avoid re-splitting elements. https://www.shellcheck.net/wiki/SC2068 --- src/mono/mono/arch/riscv/riscv-codegen-test.sh | 2 +- src/native/libs/verify-entrypoints.sh | 2 +- src/tests/Common/scripts/bringup_runtest.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/arch/riscv/riscv-codegen-test.sh b/src/mono/mono/arch/riscv/riscv-codegen-test.sh index 22c565b4da4b80..d0e2342da3adfe 100755 --- a/src/mono/mono/arch/riscv/riscv-codegen-test.sh +++ b/src/mono/mono/arch/riscv/riscv-codegen-test.sh @@ -8,7 +8,7 @@ else bits=32 fi -gcc -I../../.. -I../../eglib riscv-codegen-test.c -o riscv-codegen-test $@ || exit 1 +gcc -I../../.. -I../../eglib riscv-codegen-test.c -o riscv-codegen-test "$@" || exit 1 ./riscv-codegen-test > riscv-codegen.s || exit 1 riscv64-unknown-linux-gnu-as riscv-codegen.s -o riscv-codegen.elf || exit 1 riscv64-unknown-linux-gnu-objdump -D -M numeric,no-aliases riscv-codegen.elf > riscv-codegen.res || exit 1 diff --git a/src/native/libs/verify-entrypoints.sh b/src/native/libs/verify-entrypoints.sh index 9e89a5abb5d7f2..d4862e69bee682 100755 --- a/src/native/libs/verify-entrypoints.sh +++ b/src/native/libs/verify-entrypoints.sh @@ -35,7 +35,7 @@ for line in $(<$2); do fi done -diffList=$(echo -n ${entriesList[@]} ${dllList[@]} | tr " " "\n" | sort | uniq -u) +diffList=$(echo -n "${entriesList[@]}" "${dllList[@]}" | tr " " "\n" | sort | uniq -u) if [ -n "$diffList" ]; then echo "ERROR: $2 file did not match entries exported from $1" >&2 diff --git a/src/tests/Common/scripts/bringup_runtest.sh b/src/tests/Common/scripts/bringup_runtest.sh index bc944f2e9b75ec..b03f4c74991eb0 100755 --- a/src/tests/Common/scripts/bringup_runtest.sh +++ b/src/tests/Common/scripts/bringup_runtest.sh @@ -527,7 +527,7 @@ function read_array { theArray[${#theArray[@]}]=$line fi done < "$1" - echo ${theArray[@]} + echo "${theArray[@]}" } function load_unsupported_tests {