Skip to content

Commit

Permalink
Fix shellcheck issue with array
Browse files Browse the repository at this point in the history
  • Loading branch information
Raleksan committed Oct 3, 2024
1 parent 31121be commit a16a41b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions steps/report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ 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")
for idx in ${!groups[@]}; do
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}"
if [ "$idx" -eq $(( ${#groups[@]} - 1 )) ]; then
Expand Down

0 comments on commit a16a41b

Please sign in to comment.