hello head

#!/bin/bash

a[0]=1.2
a[1]=1.3

i=0
for var in ${a[@]}
do
    let i++
    sum=`echo $sum $var | awk '{ print $1+$2 } '`
done

echo $sum $i | awk ' { printf("%.3f", $1/$2) } '

 

posted on 2018-11-28 23:33  gardonkoo  阅读(428)  评论(0编辑  收藏  举报

hello foot