Skip to content

Instantly share code, notes, and snippets.

@welbornprod
Created January 31, 2013 02:44
Show Gist options
  • Save welbornprod/4679506 to your computer and use it in GitHub Desktop.
Save welbornprod/4679506 to your computer and use it in GitHub Desktop.
Translate english word to spanish in your BASH terminal. Works best as a BASH function, might have to install 'lynx' console browser. ... sudo apt-get install lynx
# BASH function
function spanish() {
if [ "${1}" = "" ] ; then
# usage: spanish [english word]
echo "Usage: spanish dog"
else
lynx -dump -nonumbers -width=160 "http://spanish.dictionary.com/definition/${1}?src=en" | grep "${1} / "
fi
}
# BASH single-line command
lynx -dump -nonumbers -width=160 "http://spanish.dictionary.com/definition/${1}?src=en" | grep "YOUR_ENGLISH_WORD / "
@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.

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