您的位置:首页 > 运维架构 > Linux

安装rlwrap解决linux下sqlplus提供浏览历史命令行的功能

2012-06-27 04:26 656 查看
rlwrap工具可以解决linux下sqlplus提供浏览历史命令行的功能,和删除先前输入错误的字母等问题。

1、安装前准备工作:

安装rlwrap所需的rpm包,系统盘中自带。

[root@ORCL RedHat]# cd RPMS/

[root@ORCL RPMS]# rpm -Uvh readline*

warning: readline-4.3-13.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e //我的提示已经安装上了,包括

readline-devel-4.3-13.i386.rpmreadline-devel-4.3-13.i386.rpm

2、安装rlwrap包

# tar zxvf rlwrap-0.37.tar.gz && cd rlwrap-0.37

查看INSTALL文件,获取安装步骤,这样可以少走不少弯路。

# less INSTALL

# chmod 755 *

# ./configure

config.status: creating doc/rlwrap.man

config.status: creating config.h

config.status: executing depfiles commands

Now do:

make (or gmake) to build rlwrap

make check for instructions how to test it

make install to install it

[root@ORCL rlwrap-0.37]# make && make install

安装完成后执行 rlwrap

# rlwrap

Usage: rlwrap [options] command ...

Options:

-a[password:] --always-readline[=password:]

-A --ansi-colour-aware

-b <chars> --break-chars=<chars>

-c --complete-filenames

-C <name|N> --command-name=<name|N>

-D <0|1|2> --history-no-dupes=<0|1|2>

-f <completion list> --file=<completion list>

-g <regexp> --forget-matching=<regexp>

-h --help

-H <file> --history-filename=<file>

-i --case-insensitive

-I --pass-sigint-as-sigterm

-l <file> --logfile=<file>

-n --no-warnings

-N --no-children

-o --one-shot

-O <regexp> --only-cook=<regexp>

-p[colour] --prompt-colour[=colour]

-P <input> --pre-given=<input>

-q <chars> --quote-characters=<chars>

-m[newline substitute] --multi-line[=newline substitute]

-r --remember

-R --renice

-v --version

-s <N> --histsize=<N> (negative: readonly)

-S <prompt> --substitute-prompt=<prompt>

-t <name> --set-term-name=<name>

-w <N> --wait-before-prompt=<N> (msec, <0 : patient mode)

-z <filter command> --filter=<filter command>

bug reports, suggestions, updates:
http://utopia.knoware.nl/~hlub/uck/rlwrap/
# vi /home/oracle/.bash_profile

alias sqlplus='rlwrap sqlplus'

alias rman='rlwrap rman'

在网上查了不少资料,基本上都大同小异,有的基本上就是转抄过去的,也不知道做没做过测试,我这边试了几次,还是没有达到预期的目的,不知道是哪里的问题,纠结。。。

本文出自 “快乐生活快乐工作” 博客,请务必保留此出处http://lecui.blog.51cto.com/3345733/910135
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: