Created
April 9, 2020 22:41
-
-
Save Oppodelldog/bcb13a6c79cf9f53fffa4e75f0a0d23a to your computer and use it in GitHub Desktop.
get some random first names
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
#!/bin/bash | |
filename="first-names.txt" | |
targetFilename="names.txt" | |
wget https://raw.githubusercontent.com/dominictarr/random-name/master/${filename} | |
length=$(cat ${filename} | wc -l) | |
truncate -s 0 ${targetFilename} | |
for i in {1..42} | |
do | |
line=$(( ($RANDOM%length ) +1)) | |
tail -n +$(( (line-1) )) first-names.txt | head -n 1 >> ${targetFilename} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment