diff --git a/bench.sh b/bench.sh index ba9d524..acb06cd 100644 --- a/bench.sh +++ b/bench.sh @@ -81,6 +81,7 @@ calc_disk() { for size in ${array[@]} do [ "${size}" == "0" ] && size_t=0 || size_t=`echo ${size:0:${#size}-1}` + [ "`echo ${size:(-1)}`" == "K" ] && size=0 [ "`echo ${size:(-1)}`" == "M" ] && size=$( awk 'BEGIN{printf "%.1f", '$size_t' / 1024}' ) [ "`echo ${size:(-1)}`" == "T" ] && size=$( awk 'BEGIN{printf "%.1f", '$size_t' * 1024}' ) [ "`echo ${size:(-1)}`" == "G" ] && size=${size_t}