mirror of
https://github.com/teddysun/across.git
synced 2025-01-19 06:19:35 +08:00
update get disk size
fixed a bug Signed-off-by: Teddysun <i@teddysun.com>
This commit is contained in:
parent
a23643e064
commit
bc7720d15b
1
bench.sh
1
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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user