当前位置: 代码迷 >> 交换机/路由器 >> 兑现类似于CISCO路由器的命令行帮助界面
  详细解决方案

兑现类似于CISCO路由器的命令行帮助界面

热度:5615   发布时间:2013-02-26 00:00:00.0
实现类似于CISCO路由器的命令行帮助界面

7.?Klish - Kommand Line Interface Shell (the fork of clish project)

http://code.google.com/p/klish/

Klish是一个命令行补全工具,可以实现类似于CISCO路由器的命令行帮助界面。它是Clish的后续版本,Klish有一个特殊的功能,可以让用户仅使用指定目录中的命令。

7.1.?安装Klish

# cd /usr/local/src/# wget http://klish.googlecode.com/files/klish-1.6.4.tar.bz2# tar jxvf klish-1.6.4.tar.bz2# cd klish-1.6.4/# ./configure --prefix=/srv/klish-1.6.4# make# make install# cp -r xml-examples /srv/klish-1.6.4/# export CLISH_PATH=/srv/klish-1.6.4/xml-examples/clish		

启动clish

		# /srv/klish-1.6.4/bin/clish*********************************************         CLISH (see-lish)                 **                                          **      WARNING: Authorised Access Only     *********************************************Welcome root it is Mon Feb 18 09:59:06 CST 2013>				

7.2.?为用户指定clish作为默认Shell

# vim /etc/passwdneo:x:1000:1000:neo,,,:/home/neo:/bin/bash		

改为

neo:x:1000:1000:neo,,,:/home/neo:/srv/klish-1.6.4/bin/clish		

7.3.?FAQ

7.3.1.?clish/shell/shell_expat.c:36:19: fatal error: expat.h: No such file or directory
clish/shell/shell_expat.c:36:19: fatal error: expat.h: No such file or directorycompilation terminated.make[1]: *** [clish/shell/libclish_la-shell_expat.lo] Error 1make[1]: Leaving directory `/usr/local/src/klish-1.6.4'make: *** [all] Error 2			

解决方案,安装expat开发包

# apt-get install libexpat1-dev
  相关解决方案