Random words from the terminal

Sep 05, '01 07:05:50AM

Contributed by: victory

Here's a nifty but somewhat useless quickie that will pick random words from the built-in dictionary file:

perl -e 'open IN, "</usr/share/dict/words";rand($.) < 1 && ($n=$_) while <IN>;print $n'
Notes:[To the editor: I admit this is sort of off-topic as far as Mac OSX is concerned. Perhaps you can use it when there's a dry spell in hints or as a 'stupid shell tricks' feature.]

[From the editor: Hey, it is a bit slow with everyone awaiting 10.1's arrival, and this is an interesting trick. There are some strange words in the dictionary!]

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20010905070550180