安装rlwrap解决方向键和退格键失效

需要安装一个rlwrap包。 rlwrap是一个基于GNU readline library的工具,可以增强Linux中的Sqlplus命令行功能,
能够使一些普通的命令行(比如Oracle中的Sqlplus、Rman等)具有历史输入回溯和错误回退修正的增强功能。 
下载完rpm安装包后,以root用户进行安装。


在安装rlwrap前,要先安装readline, readline-devel, libtermcap, libtermcap-devel

可用命令“rpm -qa | grep 程序名”来查找某个程序是否已安装

安装rlwrap解决方向键和退格键失效

1、下载地址:(For  CentOS7)
http://rpm.pbone.net/index.php3/stat/4/idpl/30448081/dir/centos_7/com/rlwrap-0.42-1.1.x86_64.rpm.html

选择其他适合版本:
http://rpm.pbone.net/index.php3?stat=3&search=rlwrap&srodzaj=3


安装rlwrap解决方向键和退格键失效

基本信息如下:
rlwrap rpm build for : CentOS 7

Name : rlwrap-0.42-1.1.x86_64.rpm
Version : 0.42 Vendor : obs://build_opensuse_org/home:Ledest:misc
Release : 1.1 Date : 2015-01-11 17:25:51
Group : Productivity/Other Source RPM : rlwrap-0.42-1.1.src.rpm
Size : 0.17 MB 
Packager : (none) 
Summary : A Readline Wrapper
Description : 
rlwrap uses the GNU readline library to allow the editing of keyboard input for
any other command. The input history is remembered across invocations, separately
for each command;history completion and search work as in bash and completion
word lists can be specified on the command line.

RPM found in directory: /mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/Ledest:/misc/CentOS_7/x86_64

Content of RPM  Changelog  Provides Requires
Download 
ftp.gwdg.de rlwrap-0.42-1.1.x86_64.rpm
ftp.pbone.net rlwrap-0.42-1.1.x86_64.rpm

2、以root用户进行安装
此RPM 包 可以直接安装,不需要其他依赖包。

安装rlwrap解决方向键和退格键失效

3、使用方法

rlwrap sqlplus 

也可将其添加到别名中   
编辑oracle用户下的.bash_profile 
增加以下两行:

alias sqlplus=’rlwrap sqlplus’ 
alias rman=’rlwrap rman’


备注:如果修改.bash_profile不能正常使用,请修改 .bashrc(通常这2个文件在/home/oracle下)

保存退出后执行以下命令立即启用即可。  
.  .bash_profile