shellcheck: Fix SC2013
SC2013 (info): To read lines rather than words, pipe/redirect to a
'while read' loop.
Not a bug.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Message-ID: <20240406123833.406488-9-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index f8aa5da..16b8d3f 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -409,7 +409,7 @@
[ ! -f "$KVM_UNIT_TESTS_ENV_OLD" ] && return
- for line in $(grep -E '^[[:blank:]]*[[:alpha:]_][[:alnum:]_]*=' "$KVM_UNIT_TESTS_ENV_OLD"); do
+ grep -E '^[[:blank:]]*[[:alpha:]_][[:alnum:]_]*=' "$KVM_UNIT_TESTS_ENV_OLD" | while IFS= read -r line ; do
var=${line%%=*}
if ! grep -q "^$var=" $KVM_UNIT_TESTS_ENV; then
eval export "$line"