mishuang 发表于 2009-02-08 00:10

在Solaris中安装dictd

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.dzweb1913.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) :
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)


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/23177/showart_1818011.html
页: [1]
查看完整版本: 在Solaris中安装dictd