Ratha (papertygre) wrote,
Ratha
papertygre

  • Mood:

outriggerless. tempestively. subfactorial.

Recently subscribed to the OSX FAQ tips of the day, and was inspired the infusion of unixy goodness. Decided to devise a one line command for fetching a random word out of /usr/share/dict/words. After much head scratching (like, bash chokes on the '!' which is part of the sed command) I finally came up with the following:

sed -e `echo "/1..\`wc -l /usr/share/dict/words | cut -f2 -d\ \`/" | xargs random`$'\041'd /usr/share/dict/words

I am amused by this.
Tags: geek, random
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 12 comments