Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This script uses the menemonic_wordlist from the mnemonic encoding project to generate a set of word pairs
#!/usr/bin/env zsh
#
# This script uses the menemonic_wordlist from the mnemonic encoding project to generate a set of word pairs
# I use them for software release naming conventions and I like choices
# You can get it for yourself with curl
# curl -Lo menmonic_wordlist.txt http://web.archive.org/web/20091003023412/http://tothink.com/mnemonic/wordlist.txt
#
#
MNEMONIC_FILE="$HOME/Documents/mnemonic_wordlist.txt"
function random_word {
WORDLINE=$(( $(($RANDOM % $(wc -l $MNEMONIC_FILE|awk '{print $1}'))) + 1))
WORDCOL=$(( $(($RANDOM % 6)) + 1 ))
WORD=$(head -$WORDLINE $MNEMONIC_FILE | tail -1 | awk -v word=$WORDCOL '{print $word }')
echo -n $WORD
}
random_word
echo -n " "
random_word
echo " "
random_word
echo -n " "
random_word
echo " "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment