Created
February 28, 2016 04:13
-
-
Save yousefamar/cb19f329045a84c639f4 to your computer and use it in GitHub Desktop.
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
#!/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