shellcheck: Fix SC2094
SC2094 (info): Make sure not to read and write the same file in the same
pipeline.
This is not as clearly bad as overwriting an input file with >, but
could appended characters possibly be read in from the input
redirection?
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20240406123833.406488-5-npiggin@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 413f3ed..5a0d8f8 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -416,6 +416,8 @@
env_errata ()
{
+ local new_env
+
if [ "$ACCEL" = "tcg" ]; then
export "ERRATA_FORCE=y"
elif [ "$ERRATATXT" ] && [ ! -f "$ERRATATXT" ]; then
@@ -424,7 +426,8 @@
elif [ "$ERRATATXT" ]; then
env_generate_errata
fi
- sort <(env | grep '^ERRATA_') <(grep '^ERRATA_' $KVM_UNIT_TESTS_ENV) | uniq -u >>$KVM_UNIT_TESTS_ENV
+ new_env=$(sort <(env | grep '^ERRATA_') <(grep '^ERRATA_' $KVM_UNIT_TESTS_ENV) | uniq -u)
+ echo "$new_env" >>$KVM_UNIT_TESTS_ENV
}
env_generate_errata ()