Linux Shell的类别

The Bourne Shell

When Unix was first born, it had a very basic shell written by Ken Thompson, one of the creatorsof Unix. The Bourne shell was written by Steve Bourne in 1979 as a scriptable Unix shell. All othershells have a prefix to qualify which shell they are — ksh, csh, zsh, and so on — but the Bourne shelldoes not call itself bsh because it simply is “the shell,” so its canonical path is /bin/sh. Other shellscame along later with more features, while staying generally compatible with the Bourne shell —some more compatible than others.One of the most significant new concepts that the Bourne shell provided was the pipeline, the structurethat allows one process to pass its output to the input of another process. This was a dramaticchange in the capability of a shell command. Bourne also introduced variables and flow control,turning the shell from being a very basic command interpreter into a flexible scripting language.

The KornShell

The Kornshell (ksh) was written by David Korn in 1983. It is a very popular shell for scripting as wellas interactive use, particularly on proprietary Unices. Like bash and dash, it is backward-compatiblewith the Bourne shell but adds new features and syntax. Ksh introduced cursor-key navigation of theshell history, as well as providing arrays and floating-point math. For a long time, ksh was proprietaryUnix software of AT&T, so pdksh (now mksh, ) is a Free Software equivalentto ksh93. After ksh93 was released under IBM’s Common Public License in 2005, most GNU/Linux distributions included ksh93 instead of pdksh or mksh, as did OpenSolaris. As a result, wheneveryou find ksh on a recent system, it is likely to be the genuine ksh93 and not a clone.

The common ground between ksh and Bourne functionality was used to define the POSIX standard for /bin/sh, so ksh is a significant shell scripting language. In traditional Unix systems, it is quiteacceptable for the root user’s shell to be set to /bin/ksh. It is the default shell on IBM’s AIX Unix./etc/init.d scripts will still be run under the Bourne shell, but the interactive root shell can be ksh(often with the -o vi option to provide vi-like history recall).Microsoft’s Services For Unix (SFU — now discontinued) provided an almost-compatible ksh shell forthe Windows environment, although it was based on mksh, which at the time was not quite compatiblewith the original ksh. At ,you can read the story of how David Korn queried a Microsoft product manager about his choice ofKornshell implementation during a presentation about SFU. Korn criticized the choice of implementationbecause it was incompatible with genuine ksh, and asked whether Microsoft had considered any ofthe more compatible ksh variants. Only after the poor Microsoft representative had tried to claim thattheir implementation of the Kornshell was fully compatible with the Kornshell was it eventually pointedout to him that the person asking the awkward questions about Kornshell compatibility was DavidKorn himself.

The C Shell

The C shell (csh) was written in the 1970s by Bill Joy, one of the founders of Sun Microsystems andalso a very prolific BSD Unix hacker. One of the main attractions of csh was that its syntax lookeda lot more like the C language, which many systems programmers are very familiar with. It was also

a better interactive shell than the Bourne shell, providing the history command for the first time. It also added job control and the concept of using the tilde (~) to represent the current user’s homedirectory. All of these features (but not the C-style syntax) have been taken on by all of the othershells listed here.In 1996, Tom Christiansen wrote a widely distributed article entitled “Csh ProgrammingConsidered Harmful” (), whichpointed out some of the ways in which csh syntax can be counterintuitive or limiting to the systemsprogrammer. The issues that Christiansen raises are particularly focused around the areas of redirectionand process control.

The Tenex C Shell

Tcsh is the Tenex Csh, and offers many improvements to the standard csh, while remaining totally compatible with csh. Its improvements over csh include better history control; pushd and popd forstacking directory positions; terminal locking; and which, where, and also read-only variables. Italso provides spelling correction; an interactive tcsh will prompt the user with suggested options if itsuspects that a typing error has been made.In addition to automatic completion of commands and filenames, tcsh also adds automatic completionof variable names. It can be configured to do this in either case-sensitive or case-insensitive mode.

The Z Shell

哪怕前方的路会充满坎坷,但为梦想而拼搏的人会永不言败

Linux Shell的类别

相关文章:

你感兴趣的文章:

标签云: