ITPub博客

首页 > Linux操作系统 > Linux操作系统 > rlwrap的使用

rlwrap的使用

Linux操作系统 作者:TaihangMeng 时间:2016-07-29 14:41:52 0 删除 编辑

在LINUX下使用ORACLE一些命令时(如sqlplus,rman等),经常需要调用上次或之前运行过的命令或者输入错误时使用回退键删除,而rlwrap就提供了这一功能。
可从以下地址获取rlwrap:
http://utopia.knoware.nl/~hlub/rlwrap/ 下载rlwrap-0.37.tar.gz
或者从以下地址获取对应版本的安装包:

http://rpm.pbone.net/index.php3/stat/4/idpl/15288816/dir/redhat_el_6/com/rlwrap-0.37-1.el6.x86_64.rpm.html

http://rpm.pbone.net/index.php3/stat/4/idpl/15276193/dir/redhat_el_5/com/rlwrap-0.37-1.el5.x86_64.rpm.html

安装
#tar zxvf rlwrap-0.37.tar.gz
#cd rlwrap-0.37
# ./configure && make && make install

或者
#rpm -ivh rlwrap-0.37-1.el6.x86_64.rpm

检查是否安装成功
[root@dg ~]# 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/



使用

--直接在命令前加上rlwrap
[oracle@dg ~]$ rlwrap sqlplus / as sysdba

或者配置环境变量,在末尾添加以下行
[oracle@dg ~]$ vi .bash_profile
stty erase ^h
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'

--使环境变量立即生效
[oracle@dg ~]$ source  .bash_profile

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30776559/viewspace-2122728/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2016-01-07

  • 博文量
    101
  • 访问量
    147090