diff --git a/src/progress.sh b/src/progress.sh index be3cba5..e50d65e 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")