From 628c12934f2aa03fdc3bcdfb9204199f38fb9d02 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 18 Mar 2025 12:08:54 +0100 Subject: [PATCH] Update reset.sh --- src/reset.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/reset.sh b/src/reset.sh index 823fd41..a69cf7f 100644 --- a/src/reset.sh +++ b/src/reset.sh @@ -112,13 +112,8 @@ fi formatBytes() { local result - result=$(numfmt --to=iec "$1") + result=$(numfmt --to=iec --suffix=B "$1" | sed -r 's/([A-Z])/ \1/' | sed 's/ B/ bytes/g;') local unit="${result//[0-9. ]}" - if [ -z "$unit" ]; then - unit="bytes" - else - unit=$(echo "${unit^^}" | sed 's/K/KB/g;s/M/MB/g;s/G/GB/g;s/T/TB/g') - fi result="${result//[a-zA-Z ]/}" if [[ "${2:-}" == "up" ]]; then if [[ "$result" == *"."* ]]; then