X-Git-Url: https://git.ralfj.de/multypo.git/blobdiff_plain/9c1e7f79952d5e4f6c8c38bb71e1c7c4dc6a3d01..7a18f439db0b8a7d55ffd0368bb0159afa79ab62:/play.sh diff --git a/play.sh b/play.sh index 288dbcf..b427eee 100755 --- a/play.sh +++ b/play.sh @@ -1,8 +1,19 @@ -#!/bin/sh +#!/bin/bash # you should probably download a txt dictionary of your favourite language and use that as a words.txt +cd "$(readlink -e $(dirname "$0"))" + WORDSTOPLAY=10 +WORDSFILE="$1" +if [[ -z "$WORDSFILE" ]]; then + WORDSFILE="words.txt" +fi -sort -R dict.txt | sed 's/\/.*//' | egrep '^[A-Za-z]{5,}$' | head -n $WORDSTOPLAY | tr [:upper:] [:lower:] | qt/multypo +export LC_ALL=C # dont do unicode stuff in egrep +while true; do + sort -R "$WORDSFILE" | sed 's/\/.*//' | egrep '^[A-Za-z]{5,}$' | head -n "$WORDSTOPLAY" | tr [:upper:] [:lower:] | qt/multypo + echo "Press Ctrl-C to quit" + sleep 3 +done