3 ms·
To get rid of the newlines shuf -n 4 /usr/share/dict/words | xargs | sed 's/ //g'
by anonfunction 12y ago
To get rid of the newlines
shuf -n 4 /usr/share/dict/words | xargs | sed 's/ //g'
- __david__ 12y agoOr slightly more simply: echo `shuf -n 5 /usr/share/dict/words`
- sarciszewski 12y agoMaybe add this to your .bashrc file? randword() { if [ -z $1 ]; then echo `shuf --random-source=/dev/urandom -n 5 /usr/share/dict/words` else echo `shuf --random-source=/dev/urandom -n $1 /usr/share/dict/words` fi } Test output: kobra@stormforge blah $ randword 4 crackpots fragmentation maximally Bradly's kobra@stormforge blah $ randword 6 turnover's nonproliferation's bestowal's sulkier hillbilly Narmada kobra@stormforge blah $ randword Marciano fibulas roadwork mobilizations organics kobra@stormforge blah $ randword coins bronzed housemother's forefather supposing