Command Line Dictionary Lookup with Curl

Wednesday, December 09 2009 @ 05:08 AM EST

Contributed by: Spunray

I was let down by the "app-dicts/edictionary-2.2" package for Gentoo. It is a Perl script that just does *not* work. I was getting tired of having to use a browser for simple dictionary lookups, so I wrote two Bash functions that let me define or match words via the command line and curl.
Add to your ~/.bashrc


function define {
    curl -# dict://dict.org/d:$1|tail -n +3|head -n -2|more
}

function match {
    curl -# dict://dict.org/m:$1|tail -n +3|head -n -2|more
}

Usage is simple. Just type "define onomatopoeia", and profit.
I chop off a few leading and trailing lines to make things easier to read.

0 comments



http://sinister.org/article.php?story=2009120905080246
http://sinister.org/article.php/2009120905080246