Professional Documents
Culture Documents
Unlike the Bash shell, the C shell does not allow users to scroll through the command history buffer. Instead, each previously executed command has an event number. Because of this cumbersome system and the fact that it isn't compatible with the Bourne shell, the C shell has mostly been displaced by other shells. The TC shell is an updated version of the C shell that allows command-line editing in two modes, one resembling the vi editor and the other resembling emacs. However, it has retained the drawbacks of the C shell, including incompatibility with the Bourne shell.
POSIX shells
The Portable Operating System Interface (POSIX) 1003.2 is a standard aimed at ensuring compatibility between UNIX shells. Both the Bash shell and the ksh93 version of the Korn shell satisfy the POSIX standard. There is also an updated version of the Bourne shell that meets the POSIX standard.
Shell features
The following table compares the interactive features and scripting features of the Bourne shell, the Bash shell, the Korn shell, and the TC shell. Features of the four main UNIX shells Bourne shell Korn shell Feature (sh) (ksh) Job control N Y Aliases N Y Shell functions Y Y Standard input/output redirection Y Y Directory stacks N Y Command histories N Y Command-line editing (vi/emacs) N Y
TC shell (tcsh)
Features of the four main UNIX shells Bourne shell Korn shell Feature (sh) (ksh) Username lookup N Y Login and logout watching N N Filename, username, and hostname N Y completion History completion N N Fully programmable completion N N Co-processes N Y Built-in arithmetic evaluation N Y Transparent following of symbolic N Y links Periodic command execution N N Customizable prompts N Y Spelling correction N N Automatic mailbox checking N Y Noninteractive, non-login startup N Y files Bypass of user startup files N N Specifiable startup files N Y List variables N Y Full signal trap handling Y Y File noclobber ability N Y Local variables N Y
TC shell (tcsh)
The Bourne shell has none of the advanced interactive and scripting features of the other shells. Its value lies in the fact that it's available in every flavor of UNIX and it is therefore useful for portability. The features of the Bash shell such as history completion make it especially useful for interactive use. By contrast, the Korn shell's features make it more suitable for writing and running shell scripts. For example, it supports list variables and co-processes, which the Bash shell does not. The TC shell shares many of the features of the Korn and Bash shells, and it supports additional features such as spelling correction and login watching. However, it lacks some of the scripting features of the other shells, such as shell functions and local variables.
Summary
The most popular shell environments are the Bourne shell, the Bash shell, the Korn shell, and the C shell. The Bourne shell is found on all UNIX systems, so it's a good shell for writing scripts that need to be compatible with diverse systems. The Bash shell is a version of the Bourne shell that includes additional features for interactive use. The C and TC shells use similar syntax to that of the C programming language. They're useful for scripting but are incompatible with the Bourne shell. The Korn shell is an extension of the Bourne shell that includes the enhanced scripting features of the C shell. The Portable Operating System Interface (POSIX) is a standard aimed at ensuring compatibility between UNIX shells. The Bash and Korn shells comply with the POSIX standard. There is also a version of the Bourne shell called the POSIX shell that has been updated to meet the POSIX standard.
Table of Contents
| Top of page | | Abstract | | The main shell families | | Shell features | | Summary | Copyright 2003 SkillSoft PLC. All rights reserved. SkillSoft and the SkillSoft logo are trademarks or registered trademarks of SkillSoft PLC in the United States and certain other countries. All other logos or trademarks are the property of their respective owners.