From 13a76cc66c656666991433a2155c1a73e4e96e48 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Fri, 5 Jul 2024 13:03:07 +0200 Subject: [PATCH] fix: Use mapfile to split command output in array Addresses shellcheck SC2207 --- src/script/arch-update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index b7357f4..efab644 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -384,7 +384,7 @@ list_news() { done else array_to_string=$(printf "%s\n" "${answer_array[@]}") - answer_array=($(echo "${array_to_string}" | awk '!seen[$0]++')) + mapfile -t answer_array < <(echo "${array_to_string}" | awk '!seen[$0]++') fi for num in "${answer_array[@]}"; do