linux online dict (利用有到词典和金山词典)

#!/bin/bash res=\curl -s http://www.iciba.com/$1|grep 'class="prop"' -A 10|grep '' |sed -e 's///g' -e 's/<.span>//g'|tee /dev/stderr`
if [[ $res == "" ]];then
if echo $1 |grep -q '[a-zA-Z ].';then
curl http://dict.youdao.com/w/eng/$1/#keyfrom=dict2.index 2>&1 | grep 'class="trans-container"' -A 10 |grep '//g"|sed "s///g"
else
curl http://dict.youdao.com/w/$1/#keyfrom=dict2.index 2>&1 | grep 'class="wordGroup"' -A10 |grep -o 'E2Ctranslation">.
'|grep -o '>[a-zA-Z ]+'|sed 's/>//g'
fi
fi`

你可能感兴趣的:(linux online dict (利用有到词典和金山词典))