Last active
October 6, 2017 19:04
-
-
Save cedricvidal/578cbcbc5d20c6b6dbab1dadfd2c6f2e to your computer and use it in GitHub Desktop.
Generates random words in an infinite 1Hz loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WORDFILE="/usr/share/dict/words" | |
NUMWORDS=1 | |
#Number of lines in $WORDFILE | |
tL=`awk 'NF!=0 {++c} END {print c}' $WORDFILE` | |
while : | |
do | |
rnum=$((RANDOM%$tL+1)) | |
sed -n "$rnum p" $WORDFILE | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment