From b96f4dc6973d15e1c995f5879f5730947bba3cf5 Mon Sep 17 00:00:00 2001 From: Teddysun Date: Sun, 27 Nov 2016 16:37:14 +0900 Subject: [PATCH] update Disk information --- bench.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bench.sh b/bench.sh index 02e63d4..9b70d94 100644 --- a/bench.sh +++ b/bench.sh @@ -90,7 +90,9 @@ calc_disk() { for size in ${array[@]} do [ "${size}" == "0" ] && size_t=0 || size_t=`echo ${size:0:${#size}-1}` - [ "`echo ${size:(-1)}`" == "M" ] && size=$( awk 'BEGIN{printf "%.1f", '$size_t' / 1024}' ) || size=${size_t} + [ "`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} total_size=$( awk 'BEGIN{printf "%.1f", '$total_size' + '$size'}' ) done echo ${total_size}