当前位置: 首页 > 工具软件 > bash-sensible > 使用案例 >

bash和sh的区别linux,sh和bash的区别

闻人宏盛
2023-12-01

外壳特征

下面的表格列出了我认为将使您选择一个shell而不是另一个shell的大多数特性。它并不打算成为一个明确的列表,也不包括每个可能的shell的所有可能的特性。只有在操作系统附带的版本中,或者在直接从标准发行版编译的情况下,才会认为功能在shell中。特别是下面指定的C shell是在SunOS 4上可用的。*现在有相当多的供应商发布tcsh或他们自己的增强的C shell(他们并不总是明确地表明他们正在发布tcsh)。

代码:

Job control                          N    Y    Y    Y    Y    Y    N    N

Aliases                              N    Y    Y    Y    Y    Y    N    N

Shell functions                      Y(1) N    Y    Y    N    Y    Y    Y

"Sensible" Input/Output redirection  Y    N    Y    Y    N    Y    Y    Y

Directory stack                      N    Y    Y    Y    Y    Y    F    F

Command history                      N    Y    Y    Y    Y    Y    L    L

Command line editing                 N    N    Y    Y    Y    Y    L    L

Vi Command line editing              N    N    Y    Y    Y(3) Y    L    L

Emacs Command line editing           N    N    Y    Y    Y    Y    L    L

Rebindable Command line editing      N    N    N    Y    Y    Y    L    L

User name look up                    N    Y    Y    Y    Y    Y    L    L

Login/Logout watching                N    N    N    N    Y    Y    F    F

Filename completion                  N    Y(1) Y    Y    Y    Y    L    L

Username completion                  N    Y(2) Y    Y    Y    Y    L    L

Hostname completion                  N    Y(2) Y    Y    Y    Y    L    L

History completion                   N    N    N    Y    Y    Y    L    L

Fully programmable Completion        N    N    N    N    Y    Y    N    N

Mh Mailbox completion                N    N    N    N(4) N(6) N(6) N    N

Co Processes                         N    N    Y    N    N    Y    N    N

Builtin artithmetic evaluation       N    Y    Y    Y    Y    Y    N    N

Can follow symbolic links invisibly  N    N    Y    Y    Y    Y    N    N

Periodic command execution           N    N    N    N    Y    Y    N    N

Custom Prompt (easily)               N    N    Y    Y    Y    Y    Y    Y

Sun Keyboard Hack                    N    N    N    N    N    Y    N    N

Spelling Correction                  N    N    N    N    Y    Y    N    N

Process Substitution                 N    N    N    Y(2) N    Y    Y    Y

Underlying Syntax                    sh   csh  sh   sh   csh  sh   rc   rc

Freely Available                     N    N    N(5) Y    Y    Y    Y    Y

Checks Mailbox                       N    Y    Y    Y    Y    Y    F    F

Tty Sanity Checking                  N    N    N    N    Y    Y    N    N

Can cope with large argument lists   Y    N    Y    Y    Y    Y    Y    Y

Has non-interactive startup file     N    Y    Y(7) Y(7) Y    Y    N    N

Has non-login startup file           N    Y    Y(7) Y    Y    Y    N    N

Can avoid user startup files         N    Y    N    Y    N    Y    Y    Y

Can specify startup file             N    N    Y    Y    N    N    N    N

Low level command redefinition       N    N    N    N    N    N    N    Y

Has anonymous functions              N    N    N    N    N    N    Y    Y

List Variables                       N    Y    Y    N    Y    Y    Y    Y

Full signal trap handling            Y    N    Y    Y    N    Y    Y    Y

File no clobber ability              N    Y    Y    Y    Y    Y    N    F

Local variables                      N    N    Y    Y    N    Y    Y    Y

Lexically scoped variables           N    N    N    N    N    N    N    Y

Exceptions                           N    N    N    N    N    N    N    Y

上面桌子的钥匙。

Y特性可以使用这个shell来完成。

N个特性不存在于shell中。

F特征只能通过shell函数机制来完成。

为了启用此特性,必须将读行库链接到shell中。

上表附注

1. This feature was not in the original version, but has since become

almost standard.

2. This feature is fairly new and so is often not found on many

versions of the shell, it is gradually making its way into

standard distribution.

3. The Vi emulation of this shell is thought by many to be

incomplete.

4. This feature is not standard but unofficial patches exist to

perform this.

5. A version called 'pdksh' is freely available, but does not have

the full functionality of the AT&T version.

6. This can be done via the shells programmable completion mechanism.

7. Only by specifying a file via the ENV environment variable.

 类似资料: