我最近安装了 Ubuntu,当我在终端上运行 sh 时,我的箭头键不起作用,所以我无法查看通话记录或编辑我正在输入的任何内容。它只是作为像^[[A
.
登录外壳是bash
并且它工作正常,但是一旦我切换到sh
,它们就不起作用。
我怎样才能解决这个问题?
Arc*_*ege 17
的/bin/sh
(短划线)壳是一POSIX兼容,缩减功能壳更有效(更小的),用于引导系统。作为其中的一部分,不包括历史记录和高级命令行编辑。它更适合严格的 POSIX 脚本而不是交互式 shell。这个想法是默认情况下“登录”shell 将是 bash,但引导系统将使用 dash。Ubuntu 11.04 中的手册页显示 dash 具有历史记录和命令行编辑功能,但该程序没有这些功能。查看基本可执行文件的大小。
$ ls -l /bin/*ash /bin/sh
-rwxr-xr-x 1 root root 822420 Mar 31 15:26 /bin/bash
-rwxr-xr-x 1 root root 83848 Nov 15 2010 /bin/dash
lrwxrwxrwx 1 root root 4 May 17 21:15 /bin/rbash -> bash
lrwxrwxrwx 1 root root 4 May 17 21:15 /bin/sh -> dash
$ strings /bin/bash | egrep -ci 'fc|hist'
181
$ strings /bin/dash | egrep -ci 'fs|hist'
1
Run Code Online (Sandbox Code Playgroud)
尝试习惯运行$SHELL
或bash
而不只是sh
.
sh
没有任何历史。至少,我的没有:
server$ sh
\h$ history
sh: history: not found
\h$ fc
sh: fc: not found
\h$ exit
server$ type sh
sh is hashed (/bin/sh)
server$ ll /bin/sh
lrwxrwxrwx 1 root root 4 Jun 1 18:43 /bin/sh -> dash*
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
14289 次 |
最近记录: |