Start hacking on a C(++) implementation of the optimizer
[evolve-layout.git] / get_the_best_layouts.sh
blob0ab34cdc67b23c5e99f9845860c6f96da0792cbd
1 #!/bin/bash
3 # get the best layouts from a given file.
5 if [ $# -lt 1 ]; then
6 echo "usage: $0 <filename> [<number of layouts>]"
7 exit 0
8 fi
10 if [ "$1" == "--help" ]; then
11 echo "usage: $0 <filename> [<number of layouts>]"
12 exit 0
15 export NUMBER=3
17 if [ $# -eq 2 ]; then
18 export NUMBER=$2
21 for i in $(grep "total penalty per letter" $1 | sort -u -r | tail -n $NUMBER | cut -d " " -f 2 | xargs)
22 do grep -m 1 $i $1 -A 11 -B 17
23 done