0

I'm writing as script in bash with the purpose of creating characters for purpose of role-playing, and writing. How to i have my script read and randomly select first names from my list (of over 1,000 names)? Also, is there a way that i need to number each entry so that bash will randomly select one word? (Each word is already in its own line.)

Ps: Please just tell me if I'm posting this question on the wrong Stack Exchange site.

  • I think you're posting a duplicate question of many that have already been asked... did you try searching? – l'L'l May 30 '17 at 22:17
  • @I'L'I I did try searching. If this is a duplicate question, would you please link me to the other? –  May 30 '17 at 22:19

1 Answers1

0

try this:

shuf -n3 names.txt

(selects 3 random names from names.txt)

(source: https://stackoverflow.com/a/15065490)

webb
  • 4,180
  • 1
  • 17
  • 26