mirror of
https://github.com/teddysun/across.git
synced 2025-01-31 12:19:35 +08:00
update Disk information
This commit is contained in:
parent
95c2bab52a
commit
b96f4dc697
4
bench.sh
4
bench.sh
@ -90,7 +90,9 @@ calc_disk() {
|
|||||||
for size in ${array[@]}
|
for size in ${array[@]}
|
||||||
do
|
do
|
||||||
[ "${size}" == "0" ] && size_t=0 || size_t=`echo ${size:0:${#size}-1}`
|
[ "${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'}' )
|
total_size=$( awk 'BEGIN{printf "%.1f", '$total_size' + '$size'}' )
|
||||||
done
|
done
|
||||||
echo ${total_size}
|
echo ${total_size}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user