#!/bin/awk -f #it evaluates average and standard variation of the average #col is the column we are interested into #sum keeps the sum of all the values in this column #sum2 keeps the sums of the squared values #N keeps the number of lines BEGIN{sum=sum2=N=0} { if (NF != 0) { sum+=$col; sum2+=$col*$col; N++; } } END{print sum/N, sqrt((sum2-sum*sum/N)/(N * (N-1)));}