1awk '/^d k/ { print $5 - $3 }' \ 2| sort -n \ 3| awk ' 4 { x += 1; cumulative[$1] = x } 5 END { 6 if (x > 0) { 7 for (p = 0;p <= 100;++p) mindel[p] = -1 8 for (d in cumulative) { 9 p = int((cumulative[d] * 100) / x) 10 if (mindel[p] == -1) mindel[p] = d 11 else if (d < mindel[p]) mindel[p] = d 12 totdel[p] += d 13 numdel[p] += 1 14 } 15 td = 0 16 nd = 0 17 for (p = 0;p <= 100;++p) { 18 td += totdel[p] 19 nd += numdel[p] 20 if (p >= 10) 21 if (nd > 0) 22 if (mindel[p] >= 0) { 23 str1 = sprintf("%.2f",mindel[p]) 24 str2 = sprintf("%.2f",td / nd) 25 print str1, str2, p 26 } 27 } 28 } 29 } 30' 31