Skip to content
Karl Dahlke edited this page Aug 3, 2020 · 4 revisions

Dictionary lookup.

An easy, commandline tool to look up the definition of a word. Sample functions are based on merriam-webster.com, but can be tweaked for other online dictionaries. First, a simple bash wrapper to verify one argument, and then call edbrowse. Then, an edbrowse function to go to the website, and print the definition, or the spelling suggestions if you spelled it wrong.

#  mw lookup on a word, one arg
function mw() {
    if [ $# != 1 ]
    then
        echo "usage: mw word"
        return
    fi
    edbrowse "<mw $1"
}

# I don't need javascript for this
nojs = merriam-webster.com
# mw word lookup
function+mw {
    b http://www.merriam-webster.com/dictionary/~0
    /spelling suggestion/X
    if(?) {
        /^Definition/X
    }
    /./p
}