-
-
Save jacobsalmela/d92b8d9e297ec07a2683289f22ee53c3 to your computer and use it in GitHub Desktop.
This script uses the menemonic_wordlist from the mnemonic encoding project to generate a set of word pairs
This file contains 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
#!/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