Linux shell 查询字典

728x15 ad here

出自Guoshuang Wiki

跳转到: 导航, 搜索

Code Listing 1: ~/bin/thes

#!/bin/sh 
 #-------- 
 # Command line thesaurus 
 
 BROWSER="/usr/bin/lynx -source" 
 WEBSITE="http://thesaurus.reference.com/search?q=$1" 
 HTML2TEXT="/usr/bin/html2text -style compact" 
 
 if test $1; then 
    ${BROWSER} ${WEBSITE} | ${HTML2TEXT} | ${PAGER} 
 else 
    echo "Usage: $0 word" 
    exit 1 
 fi

To use this script, name it thes, make it executable, and make sure that it's in your $PATH. Then, run the script followed by the word you're interested in.

Code Listing 2

$ thes word
个人工具
125x125 ad here
Advertisement
120x600 ad here