1 i=0 2 for s in stat* 3 do 4 5 let i=i+1 6 7 if [ $i == 1 ]; then 8 awk '{print $1}' $s > TmpProp 9 awk '{print $2*$2}' $s > TmpErr2Prop 10 else 11 awk '{print $1}' $s > tmp 12 paste tmp TmpProp > more 13 awk '{print $1+$2}' more > TmpProp 14 15 awk '{print $2}' $s > tmp 16 paste tmp TmpErr2Prop > more 17 awk '{print $1+$2}' more > TmpErr2Prop 18 fi 19 done 20 21 awk '{print $1/n}' n=$i TmpProp > more; mv more TmpProp 22 awk '{print sqrt($1)/n}' n=$i TmpErr2Prop > more; mv more TmpErr2Prop 23 paste TmpProp TmpErr2Prop > more 24 awk '{printf("%6.2f\t%6.2f\n",$1, $2)}' more > TotalProp 25 26 rm -f TmpProp 27 rm -f TmpErr2Prop 28 rm -f more 29 rm -f tmp