当前位置: 首页 > news >正文

解决linux oracle shell上下箭调用历史命令

大家都知道linux下的shell环境中,使用sqlplus进行工作的时候无法像在windows环境下的使用上下键进行历史命令切换,确实非常不方便,还好,有了rlwrap这个玩意儿,按照后进行简单的环境配置,就可以解决这个问题了。

版本 rhel5u4
1、下载进行安装
configure-->make-->make install

<!--more-->

Last login: Sun Nov 28 20:21:41 2010
[root@gtlions ~]# ls
anaconda-ks.cfg Desktop install.log install.log.syslog rlwrap-0.37 rlwrap-0.37.tar.gz
[root@gtlions ~]# cd rlwrap-0.37
[root@gtlions rlwrap-0.37]# ls
aclocal.m4 BUGS completions configure COPYING filters Makefile.am NEWS README test tools
AUTHORS ChangeLog config.h.in configure.ac doc INSTALL Makefile.in PLEA src TODO
[root@gtlions rlwrap-0.37]# ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-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/4274/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

[root@gtlions rlwrap-0.37]# make
make all-recursive
make[1]: Entering directory `/root/rlwrap-0.37'
Making all in doc
make[2]: Entering directory `/root/rlwrap-0.37/doc'
sed -e 's#@DATADIR@#/usr/local/share#' rlwrap.man > rlwrap.1
make[2]: Leaving directory `/root/rlwrap-0.37/doc'
Making all in src
make[2]: Entering directory `/root/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: In function 鈥榗olourless_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 `/root/rlwrap-0.37/src'
Making all in filters
make[2]: Entering directory `/root/rlwrap-0.37/filters'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/rlwrap-0.37/filters'
make[2]: Entering directory `/root/rlwrap-0.37'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/root/rlwrap-0.37'
make[1]: Leaving directory `/root/rlwrap-0.37'
[root@gtlions rlwrap-0.37]# make install
Making install in doc
make[1]: Entering directory `/root/rlwrap-0.37/doc'
make[2]: Entering directory `/root/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 `/root/rlwrap-0.37/doc'
make[1]: Leaving directory `/root/rlwrap-0.37/doc'
Making install in src
make[1]: Entering directory `/root/rlwrap-0.37/src'
make[2]: Entering directory `/root/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 `/root/rlwrap-0.37/src'
make[1]: Leaving directory `/root/rlwrap-0.37/src'
Making install in filters
make[1]: Entering directory `/root/rlwrap-0.37/filters'
make[2]: Entering directory `/root/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 `/root/rlwrap-0.37/filters'
make[1]: Leaving directory `/root/rlwrap-0.37/filters'
make[1]: Entering directory `/root/rlwrap-0.37'
make[2]: Entering directory `/root/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 `/root/rlwrap-0.37'
chmod a+x /usr/local/share/rlwrap/filters/*
make[3]: Leaving directory `/root/rlwrap-0.37'
make[2]: Leaving directory `/root/rlwrap-0.37'
make[1]: Leaving directory `/root/rlwrap-0.37'
[root@gtlions rlwrap-0.37]# rl
rlatopam rletopnm rlog rlogin rlogin-cwd rlwrap
2、配置oracle的.bash_profile文件[root@gtlions rlwrap-0.37]# vi /home/oracle/.bash_profile
增加如下两行
alias 'sqlplus /nolog'='rlwrap sqlplus /nolog'
alias sqlplus='rlwrap sqlplus'
3、好了,现在你用oracle进行sqlplus或者sqlplus /nolog进行操作吧,试试上下键看看。
-The End-

<xhtml></xhtml>

相关文章:

  • 模板 BFS
  • 类加载器及其委托机制的深入分析
  • 《.NET 4.0面向对象编程漫谈》勘误表(2011年1月14日更新)
  • 【转】Android中的内存管理--不错不错,避免使用枚举类型
  • VisualSVN server安装及使用 转
  • Protobuf-net学习笔记
  • how to solve ORA-02293
  • (floyd+补集) poj 3275
  • 我大四了,oh,我要毕业了 _随笔
  • MeeGo handset 1.1开发环境[3]:直接使用Qemugl
  • Resharper
  • C++ VS C#(1):注释,变量,控制台输出
  • 我的java mvc
  • 项目管理学习笔记三:项目管理一般知识
  • Markdown——入门指南
  • [case10]使用RSQL实现端到端的动态查询
  • __proto__ 和 prototype的关系
  • 5、React组件事件详解
  • Facebook AccountKit 接入的坑点
  • flutter的key在widget list的作用以及必要性
  • JAVA 学习IO流
  • JavaScript-Array类型
  • Java比较器对数组,集合排序
  • JS基础之数据类型、对象、原型、原型链、继承
  • OSS Web直传 (文件图片)
  • Sublime Text 2/3 绑定Eclipse快捷键
  • vue 配置sass、scss全局变量
  • WordPress 获取当前文章下的所有附件/获取指定ID文章的附件(图片、文件、视频)...
  • 分布式事物理论与实践
  • 服务器之间,相同帐号,实现免密钥登录
  • 将回调地狱按在地上摩擦的Promise
  • 如何学习JavaEE,项目又该如何做?
  • MyCAT水平分库
  • ​人工智能之父图灵诞辰纪念日,一起来看最受读者欢迎的AI技术好书
  • #13 yum、编译安装与sed命令的使用
  • #vue3 实现前端下载excel文件模板功能
  • #我与Java虚拟机的故事#连载06:收获颇多的经典之作
  • (33)STM32——485实验笔记
  • (html5)在移动端input输入搜索项后 输入法下面为什么不想百度那样出现前往? 而我的出现的是换行...
  • (备忘)Java Map 遍历
  • (附源码)springboot宠物医疗服务网站 毕业设计688413
  • (附源码)ssm考试题库管理系统 毕业设计 069043
  • (论文阅读32/100)Flowing convnets for human pose estimation in videos
  • (三十五)大数据实战——Superset可视化平台搭建
  • (深度全面解析)ChatGPT的重大更新给创业者带来了哪些红利机会
  • (四) 虚拟摄像头vivi体验
  • (一)UDP基本编程步骤
  • (一)搭建springboot+vue前后端分离项目--前端vue搭建
  • (正则)提取页面里的img标签
  • (转) Face-Resources
  • (转)负载均衡,回话保持,cookie
  • (转)甲方乙方——赵民谈找工作
  • (转)微软牛津计划介绍——屌爆了的自然数据处理解决方案(人脸/语音识别,计算机视觉与语言理解)...
  • .NET Core 实现 Redis 批量查询指定格式的Key
  • .NET 实现 NTFS 文件系统的硬链接 mklink /J(Junction)