Last active
December 11, 2015 23:49
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
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
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.