Created
March 28, 2011 11:07
-
-
Save vayn/890293 to your computer and use it in GitHub Desktop.
命令行字典外加保存到在线生词本
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
# .bashrc | |
function vasa { | |
if [ ! "$*" ]; then | |
echo 'Oops, I need food!' | |
return 1 | |
fi | |
gougou $* | |
echo "$* #vasa" | bti | |
} | |
#!/bin/bash | |
# Command line Google dictionary | |
echo "----------------------------" | |
curl --output /tmp/gdict.tmp -s -A 'Mozilla/4.0' 'http://www.google.com.hk/dictionary?aq=f&langpair=en|zh-CN&q='$1'&hl=en' | |
cat /tmp/gdict.tmp | html2text -utf8 -nobs -style compact -width 1000 | sed -n -e '/^ /p'| sed '1,4d' | head -n -1 | |
#EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment