From b8c3c555747ad0d08717276089f2f5f6c19f36cd Mon Sep 17 00:00:00 2001 From: James Coleman Date: Tue, 16 Jun 2026 13:27:29 -0500 Subject: [PATCH] Fix shellcheck SC2013 warnings in byte-counting loops --- mirror-sync.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mirror-sync.sh b/mirror-sync.sh index 0cc6dae..5a7fbd5 100644 --- a/mirror-sync.sh +++ b/mirror-sync.sh @@ -367,12 +367,14 @@ build_trace_content() { total=$(( total + bytes )) done elif [[ -f $LOGFILE_STAGE1 ]]; then - for bytes in $(sed -Ene 's/(^|.* )sent ([0-9]+) bytes received ([0-9]+) bytes.*/\3/p' "$LOGFILE_STAGE1"); do + all_bytes=$(sed -Ene 's/(^|.* )sent ([0-9]+) bytes received ([0-9]+) bytes.*/\3/p' "$LOGFILE_STAGE1") + for bytes in $all_bytes; do total=$(( total + bytes )) done fi if [[ -f $LOGFILE_STAGE2 ]]; then - for bytes in $(sed -Ene 's/(^|.* )sent ([0-9]+) bytes received ([0-9]+) bytes.*/\3/p' "$LOGFILE_STAGE2"); do + all_bytes=$(sed -Ene 's/(^|.* )sent ([0-9]+) bytes received ([0-9]+) bytes.*/\3/p' "$LOGFILE_STAGE2") + for bytes in $all_bytes; do total=$(( total + bytes )) done fi