Linux Shell category

Source: Internet
Author: User
The Bourne shell

when Unix was first born, it had a very basic shell written by Ken Thompson, one of the creators
of UNIX. the Bourne shell was written by Steve Bourne in 1979 as a Scriptable Unix shell. all other
shells have a prefix to qualify which Shell they are-ksh, CSH, zsh, and so on-but the Bourne shell
does not call itself bsh because it simply is "the shell," so its canonical path is/bin/sh. other shells
came 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 structure
that allows one process to pass its output to the input of another process. this was a dramatic
change 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 well
As interactive use, maid on proprietary unices. Like bash and dash, It is backward-compatible
With the Bourne shell but adds new features and syntax. ksh introduced cursor-key navigation of
Shell history, as well as providing arrays and floating-point math. For a long time, KSh was proprietary
UNIX Software of at&t, so pdksh (now mksh, http://mirbsd.de/mksh) is a free software equivalent
To 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, whenever
You 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 quite
Acceptable 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
The Windows environment, although it was based on mksh, which at the time was not quite compatible
With the original KSh. At http://lists.blu.org/pipermail/discuss/1998-August/002393.html,
You can read the story of how David Korn queried a Microsoft Product Manager about his choice
Kornshell implementation during a presentation about SFU. Korn criticized the choice of implementation
Because it was incompatible with genuine ksh, and asked whether Microsoft had considered any
The more compatible KSh variants. Only after the poor Microsoft representative had tried to claim that
Their implementation of the kornshell was fully compatible with the kornshell was it eventually pointed
Out to him that the person asking the awkward questions about kornshell compatibility was David
Korn himself.

The C Shell

the C shell (CSH) was written in the 1970 s by Bill Joy, one of the founders of Sun Microsystems and
also a very prolific bsd unix hacker. one of the main attractions of CSH was that its syntax looked
a lot more like the C language, which has systems programmers are very familiar. 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 home
Directory. All of these features (but not the C-style syntax) have been taken on by all of the other
Shells listed here.
In 1996, Tom Christiansen wrote a widely distributed article entitled "CSH Programming
Considered harmful "(http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/), which
Pointed out some of the ways in which CSH syntax can be counterintuitive or limiting to the Systems
Programmer. The issues that Christiansen raises are participating ly focused around the areas of redirection
And process control.

The tenex C Shell

 

Tcsh is the tenex CSH, and offers extends improvements to the standard CSH, while remaining totally
Compatible with CSH. Its improvements over CSH include better history control; pushd and popd
Stacking directory positions; terminal locking; and which, where, and also read-only variables. It
Also provides spelling correction; an interactive tcsh will prompt the user with suggested options if it
Suspects that a typing error has been made.
In addition to Automatic completion of commands and filenames, tcsh also adds Automatic completion
Of variable names. It can be configured to do this in either case-sensitive or case-insensitive mode.

The Z Shell

 

The Z shell (zsh) was written by Paul Falstad in 1990. It was intended to be a KSh-like shell but also
Included some CSH-like features because CSH was a very popular interactive shell in the 1970 s and
1980 s. It is particle Ly good as an interactive shell. It does not claim full POSIX or Bourne compatibility,
Which allows it greater flexibility to add new features, although it does aim to be KSh compatible.
It can change its behavior with the emulate command, or if called as/bin/sh or/bin/ksh,
Act more like those shells.
Zsh is a lot like bash for interactive use, with similar, although in some ways more featureful, history
Recall and command completion. The compctl command can be used to customize just how
Completion Works. globbing syntax is slightly different from KSh And Bourne shell, and arrays are
Indexed from 1, not 0.

The Bourne again shell

 

Bash is the standard Interactive Shell on most GNU/Linux and Mac OSX systems, and is becoming
Popular with traditional Unix users, too. It is also the default shell for the cygwin environment,
Which provides GNU tools under Microsoft Windows. It is compatible with the Bourne shell,
Adds a number of extra features, most of which are covered in this book. The name of the bash shell
(The "Bourne again shell") is a play on the name of the author of the Bourne shell.

Bash was initially written by Brian Firefox in 1988 for the Free Software Foundation (FSF) and is currently
Maintained by Chet Ramey. It takes some ideas from varous shells including CSH and KSh.
Most noticeably, bash uses [[... ], $ (... ), And ((... ) Syntaxes from KSh.
Bash, if called as SH, acts more like the Bourne shell in the confi guration fi les it reads. This is too ented
In more detail later in this chapter.

The Debian almqualified Shell

 

Dash started life in 1989 as the almshells (Ash), written by kenth almshells. It was ported
The Debian project in 1999 by Herbert Xu as the Debian almshells (DASH). Like bash, it aims
POSIX compliance, but unlike bash, it tries nothing more; it aims only to be a POSIX-compliant shell.
This makes it smaller, lighter, and faster than Bash. It therefore replaces Bash as the default/bin/sh in
Using GNU/Linux distributions, which generally retain bash for interactive use, using dash for System
Scripts, fig startup scripts.
The longstanding availability of Bash as/bin/sh on GNU/Linux caused some problems when
Migrating to dash, as a lot of system scripts called/bin/sh as their interpreter but expected
To be able to use features of Bash. The site https://bugs.launchpad.net/ubuntu/+source/
Dash/+ bug/61463 provides a list of bugs of the problems experienced when Ubuntu 6.10 moved
From Bash to dash as the default/bin/sh in 2006.

 

Shell scripting expert recip es for Linux, Bash, and more

Seve Parker ISBN: 978-0-470-02448-5

Linux Shell scrpting with Bash

Linux Shell scripting cookbooks 4397758.8717885311

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.