mirror of
https://github.com/teddysun/across.git
synced 2025-02-23 23:49:33 +08:00
update Disk size (round float number)
This commit is contained in:
parent
3495a4caa5
commit
29da548407
4
bench.sh
4
bench.sh
@ -90,8 +90,8 @@ 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{print '$size_t' / 1024}' ) || size=${size_t}
|
||||
total_size=$( awk 'BEGIN{print '$total_size' + '$size'}' )
|
||||
[ "`echo ${size:(-1)}`" == "M" ] && size=$( awk 'BEGIN{printf "%.1f", '$size_t' / 1024}' ) || size=${size_t}
|
||||
total_size=$( awk 'BEGIN{printf "%.1f", '$total_size' + '$size'}' )
|
||||
done
|
||||
echo ${total_size}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user