From 03d1b17f8e5ab8f150241412a12f470bd17c2519 Mon Sep 17 00:00:00 2001 From: Aleksandr Ryabov Date: Thu, 3 Oct 2024 22:17:41 +0300 Subject: [PATCH] Fix shellcheck issue with array --- steps/report.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/steps/report.sh b/steps/report.sh index 520de9cb..f296d5f9 100755 --- a/steps/report.sh +++ b/steps/report.sh @@ -52,7 +52,10 @@ st_list=${TARGET}/temp/structured-list-of-metrics.tex rm -f "${st_list}" touch "${st_list}" -groups=($(grep -oP '\[.*?\]' "${list}" | sed 's/[][]//g' || : ) "Ungrouped metrics") +groups=() +while IFS='' read -r line; do + groups+=("$line") +done < <(grep -oP '\[.*?\]' "${list}" | sed 's/[][]//g' || : ; echo "Ungrouped metrics") for idx in ${!groups[@]}; do printf "\\item %s\n" "${groups[$idx]}" >> "${st_list}" printf "\\\\begin{itemize}\n" >> "${st_list}"