From a8c8b84cd670d52950b3c28cfa665d2c249e6578 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sat, 4 May 2024 16:07:52 +0200 Subject: [PATCH] fix: Ignore zero sizes --- src/progress.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/progress.sh b/src/progress.sh index be3cba54..e50d65e5 100644 --- a/src/progress.sh +++ b/src/progress.sh @@ -25,7 +25,7 @@ do if [ -s "$file" ]; then bytes=$(du -sb "$file" | cut -f1) if (( bytes > 1000 )); then - if [ -z "$total" ]; then + if [ -z "$total" ] || [[ "$total" == "0" ]]; then size=$(numfmt --to=iec --suffix=B "$bytes" | sed -r 's/([A-Z])/ \1/') else size=$(printf '%.1f\n' "$((bytes*100*100/total))e-2")