Created
July 20, 2011 15:23
-
-
Save sputnikus/1095164 to your computer and use it in GitHub Desktop.
Google Translate command line
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
#!/bin/bash | |
if [ $# == 3 ]; then | |
echo "From: $1 To: $2" | |
lynx -dump "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$3&langpair=$1|$2"|awk -F'"' '{print $6}' | |
else | |
lynx -dump "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=|cs"|awk -F'"' '{print "From: "$10" To: cs \n"$6}';echo | |
lynx -dump "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=|en"|awk -F'"' '{print "From: "$10" To: en \n"$6}';echo | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment