#!/bin/sh # # generate statistics on the randomness for the seating plan program n="${1:-100}" for i in `seq "$n"` ; do awk -f ../mapping.awk <../persons | pr -tn done | sort -n | uniq -c | sort -k3 -k2n | awk -v n="$n" ' BEGIN { printf("%-10s\t%s\t%s\n", "Name", "Seat", "Probability") } { $1 = 100 * $1 / n printf("%-10s\t%2d\t%3d%%\n", $3, $2, $1) }'