Random Topic Generator
It happens way too often. You’re in an msn conversation with someone who’s really cool, then the conversation runs dry. But you really don’t want it to end. You could be completely random like me, and change the topic if the previous topic runs dry.
/usr/share/dict/words contains a comprehensive list of wacky words (some that don’t look like real words to me, and many plurals that have apostrophes for no good reason). These could be potential topic ideas. It has many proper nouns, so first we must filter out words beginning with capital letters. Then take a random number, modulo the number of words, and find the nth element in the filtered list
x=$RANDOM;let x%=`grep "^[:lower:]" /usr/share/dict/words | wc -l`; grep "^[:lower:]" /usr/share/dict/words | head -n$x | tail -n1

That’s cool
Comment by Jemma — 3 June 2008 @ 1:52 am