allow passing words file as argument
[multypo.git] / play.sh
1 #!/bin/bash
2
3 # you should probably download a txt dictionary of your favourite language and use that as a words.txt
4
5 WORDSTOPLAY=10
6 WORDSFILE="$1"
7 if [[ -z "$WORDSFILE" ]]; then
8         WORDSFILE="words.txt"
9 fi
10
11 export LC_ALL=C # dont do unicode stuff in egrep
12 sort -R "$WORDSFILE" | sed 's/\/.*//' | egrep '^[A-Za-z]{5,}$' | head -n $WORDSTOPLAY | tr [:upper:] [:lower:]  | qt/multypo
13