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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This no longer works. They updated their page. I rewrote mine in Python (more flexible anyway).