Chinaunix首页 | 论坛 | 博客
  • 博客访问: 688694
  • 博文数量: 33
  • 博客积分: 10032
  • 博客等级: 上将
  • 技术积分: 1383
  • 用 户 组: 普通用户
  • 注册时间: 2006-08-22 18:53
文章分类

全部博文(33)

文章存档

2011年(4)

2010年(10)

2009年(14)

2008年(5)

我的朋友

分类:

2009-02-08 00:10:17

1. 下载libmaa-1.1.0.tar.gz安装到/usr

2. 下载dictd-1.9.15.tar.gz安装到/usr/local

3. 下载dict-web1913-1.4-pre.tar.gz解压到/usr/share/dict
# ls /usr/share/dict
web1913.dict.dz  web1913.index

4. 创建配置文件/usr/local/etc/dictd.conf
site localhost

access {
    allow *
}

database web1913 {
    data "/usr/share/dict/web1913.dict.dz"
    index "/usr/share/dict/web1913.index"
    access {
        allow *
    }
}

5. 创建用户配置文件~/.dictrc
server localhost {port 2628}

6. 添加如下内容到~/.bashrc,假设字典服务器的名称叫necho,(当然你也可以配置/etc/init.d,不过下面的方法更简单)
[[ -z $(pgrep dictd) ]] && /usr/local/dictd-1.9.15/dictd
或者
[[ "$HOSTNAME" == "necho" && -z $(pgrep dictd) ]] && /usr/local/dictd-1.9.15/dictd
alias d='dict'
或者
alias d='dict -h necho'
export PAGER='/usr/bin/less -ins'

7. 使用字典
$ d java
1 definition found

From Webster's Revised Unabridged Dictionary (1913) [web1913]:

  Java \Ja"va\, n.
     1. One of the islands of the Malay Archipelago belonging to
        the Netherlands.
 
     2. Java coffee, a kind of coffee brought from Java.
 
     {Java cat} (Zo["o]l.), the musang.
 
     {Java sparrow} (Zo["o]l.), a species of finch ({Padda
        oryzivora}), native of Java, but very commonly kept as a
        cage bird; -- called also {ricebird}, and {paddy bird}. In
        the male the upper parts are glaucous gray, the head and
        tail black, the under parts delicate rose, and the cheeks
        white. The bill is large and red. A white variety is also
        kept as a cage bird.
(END) 
阅读(1164) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~