Skip to content

Instantly share code, notes, and snippets.

@welbornprod
Last active December 11, 2015 23:49
Show Gist options
  • Save welbornprod/4679528 to your computer and use it in GitHub Desktop.
Save welbornprod/4679528 to your computer and use it in GitHub Desktop.
Show the definition of an english word in your BASH terminal. Works best as a BASH function, might need to install 'lynx' console browser. ... sudo apt-get install lynx
# BASH function (As of 08/13/14 this no longer works (they finally change the layout of the page.)
# It is kept here as a reference, in case someone wants to make a different version.
# ..mine is in Python now :)
function define() {
if [ "${1}" = "" ] ; then
echo "Usage: define dog"
else
lynx -dump -nonumbers -width=160 "http://dictionary.reference.com/browse/${1}" | grep -A15 "World English Dictionary"
fi
}
# BASH single-line command
lynx -dump -nonumbers -width=160 "http://dictionary.reference.com/browse/ENGLISH_WORD_HERE" | grep -A15 "World English Dictionary"
@welbornprod
Copy link
Author

This is part of a series of old-school BASH commands that I picked up a long time ago. The problem was none of those commands worked. The server they connected to had been moved, or changed the format of their pages. So I re-wrote a couple of my favorites, and saved them here for anyone to use. As of today, all of these commands work.

@welbornprod
Copy link
Author

This no longer works. They updated their page. I rewrote mine in Python (more flexible anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment