Linux下安装rlwrap工具

rlwrap 可以用来支持Oracle下sqlplus历史命令的回调功能,提高工作效率。

下载rlwrap程序包

上传服务器中

在安装rlwrap程序包之前要先安装readline包,建议使用Yum安装,这样有相关关联程序包就可以直接安装了

先查询是否readline包

[[email protected] ~]# rpm -ivh /mnt/cdrom/Packages/read
readahead-1.5.6-2.el6.x86_64.rpm     readline-6.0-4.el6.x86_64.rpm        readline-devel-6.0-4.el6.x86_64.rpm  
readline-6.0-4.el6.i686.rpm          readline-devel-6.0-4.el6.i686.rpm

通过yum安装

[[email protected] ~]# yum install readline*
Loaded plugins: refresh-packagekit, security
EL                                                                                                                                                  | 3.7 kB     00:00 ... 
Setting up Install Process
Package readline-6.0-4.el6.x86_64 already installed and latest version
Package readline-devel-6.0-4.el6.x86_64 already installed and latest version
Nothing to do

安装readline包开始安装rlwrap包,先解压

[[email protected] soft]# tar -zvxf Linux-rlwrap-0.37.tar.gz

进入目录安装

[[email protected] rlwrap-0.37]# ./configure 
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking whether build environment is sane... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking for perl... /usr/bin/perl
checking for strip... strip
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking libutil.h usability... no
checking libutil.h presence... no
checking for libutil.h... no
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking for sys/wait.h... (cached) yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for unistd.h... (cached) yes
checking for stdint.h... (cached) yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking regex.h usability... yes
checking regex.h presence... yes
checking for regex.h... yes
checking curses.h usability... yes
checking curses.h presence... yes
checking for curses.h... yes
checking termcap.h usability... yes
checking termcap.h presence... yes
checking for termcap.h... yes
checking for term.h... yes
checking for ncurses/term.h... yes
checking argument type of tputs putc function... int
checking whether your getopt() correctly understands double colons in option string... yes
checking for an ANSI C-conforming const... yes
checking for pid_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether gcc needs -traditional... no
checking return type of signal handlers... void
checking for getopt_long... yes
checking for getopt_long... (cached) yes
checking for isastream... yes
checking for mkstemp... yes
checking for pselect... yes
checking for putenv... yes
checking for readlink... yes
checking for sched_yield... yes
checking for setenv... yes
checking for setitimer... yes
checking for setsid... yes
checking for setrlimit... yes
checking for sigaction... yes
checking for snprintf... yes
checking for strlcpy... no
checking for strlcat... no
checking for strnlen... yes
checking for system... yes
checking for openpty in -lutil... yes
checking for openpty... yes
checking for getpty... no
checking for grantpt... yes
checking for unlockpt... yes
checking for getpt... yes
checking for pty/tty type... checking pty.h usability... yes
checking pty.h presence... yes
checking for pty.h... yes
OPENPTY
configure: checking for pty ranges...
checking for tgetent... no
checking for tgetent in -lcurses... yes
checking for readline in -lreadline... yes
checking whether your readline headers know about rl_set_screen_size... yes
checking whether your readline library knows about rl_set_screen_size... checking for rl_set_screen_size... yes
checking whether your readline knows about rl_variable_value... yes
checking whether your readline knows about rl_readline_version... yes
Will rlwrap find command‘s working directory under /proc/<commands pid>/cwd? let‘s see...
checking for /proc/7870/cwd/configure.ac... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating filters/Makefile
config.status: creating doc/Makefile
config.status: creating src/Makefile
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


 ./configure  后会有如下提示,按照提示操作完成就即可

Now do:
    make (or gmake)  to build rlwrap
    make check       for instructions how to test it
    make install     to install it

[[email protected] rlwrap-0.37]# make
make  all-recursive
make[1]: Entering directory `/soft/rlwrap-0.37‘
Making all in doc
make[2]: Entering directory `/soft/rlwrap-0.37/doc‘
sed -e ‘s#@[email protected]#/usr/local/share#‘  rlwrap.man > rlwrap.1
make[2]: Leaving directory `/soft/rlwrap-0.37/doc‘
Making all in src
make[2]: Entering directory `/soft/rlwrap-0.37/src‘
gcc -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c
mv -f .deps/main.Tpo .deps/main.Po
gcc -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT signals.o -MD -MP -MF .deps/signals.Tpo -c -o signals.o signals.c
mv -f .deps/signals.Tpo .deps/signals.Po
gcc -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT readline.o -MD -MP -MF .deps/readline.Tpo -c -o readline.o readline.c
mv -f .deps/readline.Tpo .deps/readline.Po
gcc -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT pty.o -MD -MP -MF .deps/pty.Tpo -c -o pty.o pty.c
mv -f .deps/pty.Tpo .deps/pty.Po
gcc -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT completion.o -MD -MP -MF .deps/completion.Tpo -c -o completion.o completion.c
mv -f .deps/completion.Tpo .deps/completion.Po
gcc -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT term.o -MD -MP -MF .deps/term.Tpo -c -o term.o term.c
mv -f .deps/term.Tpo .deps/term.Po
gcc -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT ptytty.o -MD -MP -MF .deps/ptytty.Tpo -c -o ptytty.o ptytty.c
mv -f .deps/ptytty.Tpo .deps/ptytty.Po
gcc -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT utils.o -MD -MP -MF .deps/utils.Tpo -c -o utils.o utils.c
mv -f .deps/utils.Tpo .deps/utils.Po
gcc -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT string_utils.o -MD -MP -MF .deps/string_utils.Tpo -c -o string_utils.o string_utils.c
string_utils.c: 在函数‘colourless_strlen’中:
string_utils.c:626: 警告:赋值丢弃了指针目标类型的限定
mv -f .deps/string_utils.Tpo .deps/string_utils.Po
gcc -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT malloc_debug.o -MD -MP -MF .deps/malloc_debug.Tpo -c -o malloc_debug.o malloc_debug.c
mv -f .deps/malloc_debug.Tpo .deps/malloc_debug.Po
gcc -DHAVE_CONFIG_H -I. -I..    -DDATADIR=\"/usr/local/share\"  -g -O2 -MT filter.o -MD -MP -MF .deps/filter.Tpo -c -o filter.o filter.c
mv -f .deps/filter.Tpo .deps/filter.Po
gcc -DDATADIR=\"/usr/local/share\"  -g -O2   -o rlwrap main.o signals.o readline.o pty.o completion.o term.o ptytty.o utils.o string_utils.o malloc_debug.o filter.o  -lutil  -lreadline -lcurses
make[2]: Leaving directory `/soft/rlwrap-0.37/src‘
Making all in filters
make[2]: Entering directory `/soft/rlwrap-0.37/filters‘
make[2]: Nothing to be done for `all‘.
make[2]: Leaving directory `/soft/rlwrap-0.37/filters‘
make[2]: Entering directory `/soft/rlwrap-0.37‘
make[2]: Leaving directory `/soft/rlwrap-0.37‘
make[1]: Leaving directory `/soft/rlwrap-0.37‘
[[email protected] rlwrap-0.37]# make install
Making install in doc
make[1]: Entering directory `/soft/rlwrap-0.37/doc‘
make[2]: Entering directory `/soft/rlwrap-0.37/doc‘
make[2]: Nothing to be done for `install-exec-am‘.
test -z "/usr/local/share/man/man1" || /bin/mkdir -p "/usr/local/share/man/man1"
 /usr/bin/install -c -m 644 rlwrap.1 ‘/usr/local/share/man/man1‘
make[2]: Leaving directory `/soft/rlwrap-0.37/doc‘
make[1]: Leaving directory `/soft/rlwrap-0.37/doc‘
Making install in src
make[1]: Entering directory `/soft/rlwrap-0.37/src‘
make[2]: Entering directory `/soft/rlwrap-0.37/src‘
test -z "/usr/local/bin" || /bin/mkdir -p "/usr/local/bin"
  /usr/bin/install -c rlwrap ‘/usr/local/bin‘
make[2]: Nothing to be done for `install-data-am‘.
make[2]: Leaving directory `/soft/rlwrap-0.37/src‘
make[1]: Leaving directory `/soft/rlwrap-0.37/src‘
Making install in filters
make[1]: Entering directory `/soft/rlwrap-0.37/filters‘
make[2]: Entering directory `/soft/rlwrap-0.37/filters‘
make[2]: Nothing to be done for `install-exec-am‘.
test -z "/usr/local/share/man/man3" || /bin/mkdir -p "/usr/local/share/man/man3"
 /usr/bin/install -c -m 644 RlwrapFilter.3pm ‘/usr/local/share/man/man3‘
make[2]: Leaving directory `/soft/rlwrap-0.37/filters‘
make[1]: Leaving directory `/soft/rlwrap-0.37/filters‘
make[1]: Entering directory `/soft/rlwrap-0.37‘
make[2]: Entering directory `/soft/rlwrap-0.37‘
make[2]: Nothing to be done for `install-exec-am‘.
test -z "/usr/local/share/rlwrap" || /bin/mkdir -p "/usr/local/share/rlwrap"
/bin/mkdir -p ‘/usr/local/share/rlwrap/filters‘
 /usr/bin/install -c -m 644  filters/README filters/RlwrapFilter.pm filters/RlwrapFilter.3pm filters/count_in_prompt filters/pipeto filters/logger filters/null filters/unbackspace filters/pipeline filters/ftp_filter filters/history_format filters/simple_macro filters/template filters/scrub_prompt filters/paint_prompt filters/censor_passwords filters/listing ‘/usr/local/share/rlwrap/filters‘
/bin/mkdir -p ‘/usr/local/share/rlwrap/completions‘
 /usr/bin/install -c -m 644  completions/testclient completions/coqtop ‘/usr/local/share/rlwrap/completions‘
make  install-data-hook
make[3]: Entering directory `/soft/rlwrap-0.37‘
chmod a+x /usr/local/share/rlwrap/filters/* 
make[3]: Leaving directory `/soft/rlwrap-0.37‘
make[2]: Leaving directory `/soft/rlwrap-0.37‘
make[1]: Leaving directory `/soft/rlwrap-0.37‘

安装完后可以测试一下是否安装成功

[[email protected] rlwrap-0.37]# 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/

切换grid用户中执行一条命令查询是否可以正常翻滚操作

[[email protected]:/home/grid]$sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 12 19:16:08 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> select * from v$disk_group;
select * from v$asm_diskgroup
              *
ERROR at line 1:
ORA-01219: database not open: queries allowed on fixed tables/views only
SQL> select * from v$disk_group;
select * from v$asm_diskgroup
              *
ERROR at line 1:
ORA-01219: database not open: queries allowed on fixed tables/views only
SQL>

经测试可以在SQL环境中翻滚

时间: 2024-08-06 16:01:25

Linux下安装rlwrap工具的相关文章

Linux下安装项目管理工具Redmine

http://www.redmine.org.cn/download Linux下安装项目管理工具Redmine1.Ruby安装Ruby on Rails网站推荐使用1.8.7版. 点击(此处)折叠或打开 # wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz # tar zxvf ruby-1.8.7-p174.tar.gz # cd ruby-1.8.7-p174 # ./configure –prefix=/us

日积月累Learning Linux(一):在Linux下安装Git工具

背景: 由于项目需要,经常在github上下载开源库项目源代码.因此最近决定花时间系统学习一下Linux下的相关软件的安装方法,这里就以Git工具的安装为例进行讲解. Linux(fedora18)安装Git工具: 1)Git与Github的区别: Github是一个网站,给用户提供git服务.相当于web版的Git工具,在Github上注册个账号,就可以享受网站提供的Git服务.而Git是一个版本控制系统,与SVN.CVS是类似的概念,简单点说就是对你的文件的一种版本管理(此处所谓的版本其实就

Linux下安装rlwrap

在默认情况下,启动sqlplus,如果输入错代码想要调整,就会出现奇怪的字符,比如: SQL> conn^[[D^[[D^[[D 而rlwrap可以用来支持oracle下sqlplus历史命令的回调功能,提高工作效率. 1.下载 从http://utopia.knoware.nl/~hlub/uck/rlwrap/下载rlwrap-0.42.tar.gz,并且上传到linux中. 2.解压缩安装 [[email protected] home]# tar -zxvf rlwrap-0.42.ta

linux下安装swftools工具

swfTools是一种实用工具与Adobe Flash文件(swf文件)工作的集合.可以把(pdf/gif/png/jpeg/jpg/font/wav) 7种格式转换为swf文件.一般常用于文件在线浏览等. swftools官网及下载地址:http://www.swftools.org/download.html (1)tar -zxvf [swftools-0.9.2.tar.gz所在的实际全路径] (2)cd swftools-0.9.2 (3) ./configure  或./config

linux下安装数据库管理工具dbeaver

1  解压dbeaver: unzip dbeaver-3.4.1-ee-linux.gtk.x86_64.zip 2  拷贝解压出来的dbeaver到/usr/local/tools: cp -r dbeaver /usr/local/tools 3  在/usr/share/applications下创建快捷方式: gedit /usr/share/applications/dbeaver.desktop 内容为: [Desktop Entry] Comment=Java IDE Name=

Linux下安装yum工具

[[email protected] ~]# yum -y install fonts-chinese Loading "rhnplugin" plugin Loading "security" plugin This system is not registered with RHN. RHN support will be disabled. Setting up Install Process Parsing package install arguments

linux下多线程下载工具axel的编译安装

axel 是Linux 命令行下多线程的下载工具,支持断点续传,速度通常情况下是Wget的几倍 官方主页:http://axel.alioth.debian.org/ 源码下载: #curl -O http://pkgs.fedoraproject.org/repo/pkgs/axel/axel2.4.tar.gz/a2a762fce0c96781965c8f9786a3d09d/axel-2.4.tar.gz 编译安装: # tar -xvf axel-2.4.tar.gz  && cd

MySQL Study之--Linux下安装MySQL workbench工具

MySQL Study之--Linux下安装MySQL workbench工具 系统环境:      操作系统: RedHat EL6.4(64)      WorkBench: mysql-workbench-community-6.0.9 MySQL Workbench是一款专为MySQL设计的ER/数据库建模工具.它是著名的数据库设计工具DBDesigner4的继任者.你可以用MySQL Workbench设计和创建新的数据库图示,建立数据库文档,以及进行复杂的MySQL 迁移. MySQ

【转】Linux下XenServer管理工具安装

转载文章 - Linux下XenServer管理工具安装 Xen-Server 6.5 虚拟机安装Linux系统 vmware安装ubuntu12.04嵌套安装xen server(实现嵌套虚拟化) Citrix XenServer ® 6.5 虚拟机用户指南 2015 年 03 月 26 日 (星期四)发行 1.0 版