源码安装rlwrap 0.43(为了方便使用linux下的sqlplus)
为了linux下的sqlplus方便调用历史命令和退格,安装下rlwrap,最新版本是0.43,貌似作者已经不更新了
下载地址 https://fossies.org/linux/privat/rlwrap-0.43.tar.gz/
下载后winscp传入到linux上,然后安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | [root@localhost db] #ll|grep rlwrap -rw-r--r--. 1 root root 313139 Jul 30 08:50 rlwrap-0.43. tar .gz [root@localhost db] #tar -xzf rlwrap-0.43.tar.gz [root@localhost db] #mv rlwrap-0.43 /usr/local/rlwrap [root@localhost db] #cd /usr/local/rlwrap/ [root@localhost rlwrap] #./configure -q configure: WARNING: No termcap nor curses library found configure: error: You need the GNU readline library( ftp : //ftp .gnu.org /gnu/readline/ ) to build this program! [root@localhost rlwrap] #yum -yq install readline* Loaded plugins: langpacks, ulninfo Ignored option -q, - v , -d or -e (probably due to merging: -yq != -y -q) Package readline-6.2-10.el7.x86_64 already installed and latest version Resolving Dependencies (many more lines suppressed) Installed: readline-devel.x86_64 0:6.2-10.el7 Dependency Installed: ncurses-devel.x86_64 0:5.9-14.20130511.el7_4 Complete! [root@localhost rlwrap] #./configure -q Will rlwrap find command 's working directory under /proc/< commands pid>/cwd? let' s see... Now do : make (or gmake) to build rlwrap make check for instructions how to test it make install to install it [root@localhost rlwrap] #make && make install make all-recursive make [1]: Entering directory ` /usr/local/rlwrap ' Making all in doc make [2]: Entering directory ` /usr/local/rlwrap/doc ' sed -e 's#@DATADIR@#/usr/local/share#' rlwrap. man > rlwrap.1 make [2]: Leaving directory ` /usr/local/rlwrap/doc ' Making all in src make [2]: Entering directory ` /usr/local/rlwrap/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 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 -ltinfo make [2]: Leaving directory ` /usr/local/rlwrap/src ' Making all in filters make [2]: Entering directory ` /usr/local/rlwrap/filters ' make [2]: Nothing to be done for `all'. make [2]: Leaving directory ` /usr/local/rlwrap/filters ' make [2]: Entering directory ` /usr/local/rlwrap ' make [2]: Leaving directory ` /usr/local/rlwrap ' make [1]: Leaving directory ` /usr/local/rlwrap ' Making install in doc make [1]: Entering directory ` /usr/local/rlwrap/doc ' make [2]: Entering directory ` /usr/local/rlwrap/doc ' make [2]: Nothing to be done for ` install - exec -am'. /usr/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 ` /usr/local/rlwrap/doc ' make [1]: Leaving directory ` /usr/local/rlwrap/doc ' Making install in src make [1]: Entering directory ` /usr/local/rlwrap/src ' make [2]: Entering directory ` /usr/local/rlwrap/src ' /usr/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 ` /usr/local/rlwrap/src ' make [1]: Leaving directory ` /usr/local/rlwrap/src ' Making install in filters make [1]: Entering directory ` /usr/local/rlwrap/filters ' make [2]: Entering directory ` /usr/local/rlwrap/filters ' make [2]: Nothing to be done for ` install - exec -am'. /usr/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 ` /usr/local/rlwrap/filters ' make [1]: Leaving directory ` /usr/local/rlwrap/filters ' make [1]: Entering directory ` /usr/local/rlwrap ' make [2]: Entering directory ` /usr/local/rlwrap ' make [2]: Nothing to be done for ` install - exec -am'. /usr/bin/mkdir -p '/usr/local/share/rlwrap' /usr/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 /handle_hotkeys filters /history_format filters /simple_macro filters /template filters /scrub_prompt filters /paint_prompt filters /censor_passwords filters /listing filters /paint_prompt .py filters /handle_hotkeys .py filters /logger .py filters /pipeto .py filters /rlwrapfilter .py filters /null .py filters /censor_passwords .py filters /count_in_prompt .py filters /ftp_filter .py '/usr/local/share/rlwrap/filters' /usr/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 ` /usr/local/rlwrap ' chmod a+x /usr/local/share/rlwrap/filters/ * make [3]: Leaving directory ` /usr/local/rlwrap ' make [2]: Leaving directory ` /usr/local/rlwrap ' make [1]: Leaving directory ` /usr/local/rlwrap ' [root@localhost rlwrap] # |
添加一条别名sql到oracle用户的环境变量中并使之生效,测试后上下左右键在sqlplus中均良好使用,提升了一大截sqlplus中的代码体验
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | [oracle@localhost ~]$ cat .bashrc| grep sql alias sql= 'rlwrap sqlplus / as sysdba' [oracle@localhost ~]$ . .bashrc [oracle@localhost ~]$ sql SQL*Plus: Release 11.2.0.1.0 Production on Tue Jul 30 09:41:05 2019 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 09:41:05 SYS@study> select 1 from dual; 1 ---------- 1 Elapsed: 00:00:00.00 09:41:11 SYS@study> select 1 from dual; |
作者:九命猫幺
博客出处:http://www.cnblogs.com/yongestcat/
欢迎转载,转载请标明出处。
如果你觉得本文还不错,对你的学习带来了些许帮助,请帮忙点击右下角的推荐
博客出处:http://www.cnblogs.com/yongestcat/
欢迎转载,转载请标明出处。
如果你觉得本文还不错,对你的学习带来了些许帮助,请帮忙点击右下角的推荐
标签:
rlwrap 0.43
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决