#! /bin/bash Path="temp" mkdir $Path Seed=$RANDOM Iterations=1000 SamplePercent=0.66667 RawFile="nasa93.csv" ConvertedFile=$Path"/nasa93.csv.numeric" Method="COC81" Style="precise" ABFile=$Path"/ab.tmp" AFile=$Path"/a.tmp" BFile=$Path"/b.tmp" # convert the effort multipliers to their numeric values gawk -f "convertcsv.awk" Method=$Method Style=$Style $RawFile > $ConvertedFile # run cocomoAB to get a bunch of A,B values ./cocomoAB $ConvertedFile $Seed $Iterations $SamplePercent > $ABFile # Sort the A's and B's gawk 'BEGIN{FS=","}{print $1}' $ABFile | sort -n > $AFile gawk 'BEGIN{FS=","}{print $2}' $ABFile | sort -n > $BFile A_Min=$(gawk 'NR==1{print $1}' $AFile) A_Med=$(gawk -v Iterations=$Iterations 'NR==Iterations/2{print $1}' $AFile) A_Max=$(gawk -v Iterations=$Iterations 'NR==Iterations{print $1}' $AFile) A_Avg=$(gawk 'BEGIN{sum=0}{sum+=$1}END{print sum/NR}' $AFile) B_Min=$(gawk 'NR==1{print $1}' $BFile) B_Med=$(gawk -v Iterations=$Iterations 'NR==Iterations/2{print $1}' $BFile) B_Max=$(gawk -v Iterations=$Iterations 'NR==Iterations{print $1}' $BFile) B_Avg=$(gawk 'BEGIN{sum=0}{sum+=$1}END{print sum/NR}' $BFile) echo "#Var,Min,Med,Max,Avg" echo "A,"$A_Min","$A_Med","$A_Max","$A_Avg echo "B,"$B_Min","$B_Med","$B_Max","$B_Avg #Cleanup rm -r $Path