Created
January 31, 2013 02:44
-
-
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
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 | |
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 / " |
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.