Skip to content

Instantly share code, notes, and snippets.

@yousefamar
Created February 28, 2016 04:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yousefamar/cb19f329045a84c639f4 to your computer and use it in GitHub Desktop.
Save yousefamar/cb19f329045a84c639f4 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Prints whispery word with alternating vowels and [5, 8] length.
consonants="ptkfs"
vowels="aeo"
parts=$((5+RANDOM%4))
parity=$((RANDOM%2))
name=""
for ((i=0; i<parts; ++i))
do
if (( $parity ))
then
letter="${consonants:$((RANDOM%5)):1}"
else
letter="${vowels:$((RANDOM%3)):1}"
fi
name+="$letter"
parity=$((1-parity))
done
echo "$name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment