Skip to content

Commit

Permalink
fix: Use mapfile to split command output in array
Browse files Browse the repository at this point in the history
Addresses shellcheck SC2207
  • Loading branch information
Antiz96 committed Jul 5, 2024
1 parent 24689bc commit 13a76cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/script/arch-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 13a76cc

Please sign in to comment.