Update reset.sh
This commit is contained in:
parent
8316583e2e
commit
f5318c4165
1 changed files with 2 additions and 6 deletions
|
@ -105,13 +105,9 @@ fi
|
|||
|
||||
formatBytes() {
|
||||
local result
|
||||
result=$(numfmt --to=iec "$1")
|
||||
result=$(numfmt --to=iec --suffix=B "$1")
|
||||
result=$(echo "$result" | 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
|
||||
|
|
Loading…
Reference in a new issue