Skip to content

Instantly share code, notes, and snippets.

@spiralout
Created February 12, 2013 17:18
Show Gist options
  • Save spiralout/4771464 to your computer and use it in GitHub Desktop.
Save spiralout/4771464 to your computer and use it in GitHub Desktop.
Generate a file containing X lines of Y random words
ruby -e 'a=STDIN.readlines;X.times do;b=[];Y.times do; b << a[rand(a.size)].chomp end; puts b.join(" "); end' < /usr/share/dict/words > file.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment