X-Git-Url: https://git.ralfj.de/multypo.git/blobdiff_plain/a3b03eee588a798498c5da563938690402ed302a..48457df920b6f2c3747baa57366cc23389b3caca:/play.sh diff --git a/play.sh b/play.sh index f51371e..d9367ef 100755 --- a/play.sh +++ b/play.sh @@ -1,8 +1,13 @@ -#!/bin/sh +#!/bin/bash # you should probably download a txt dictionary of your favourite language and use that as a words.txt WORDSTOPLAY=10 +WORDSFILE="$1" +if [[ -z "$WORDSFILE" ]]; then + WORDSFILE="words.txt" +fi -sort -R dict.txt | egrep '^[A-Za-z]{5,}$' | head -n $WORDSTOPLAY | tr [:upper:] [:lower:] +export LC_ALL=C # dont do unicode stuff in egrep +sort -R "$WORDSFILE" | sed 's/\/.*//' | egrep '^[A-Za-z]{5,}$' | head -n $WORDSTOPLAY | tr [:upper:] [:lower:] | qt/multypo