Module 71 kshcshsh

Previous Table of Contents Next


Module 71
ksh/csh/sh

DESCRIPTION

The ksh (pronounced kay shell ) program is a sophisticated command processor. It is also an interpretive programming language. It reads input from the terminal keyboard, interprets the command, and makes requests to the UNIX operating system to perform the requested action. As a programming language the shell lets you store shell commands in a file and execute the file as a program.

The shell used and discussed throughout Illustrated UNIX is the enhanced shell written by David Korn. Thus it is commonly called the Korn shell. The Korn shell is usually stored on the system as ksh . For clarity the ksh notation is used.

The ksh was added in Release 4 of SV. It is not distributed with standard BSD, although many vendors offer it with their BSD type systems. If you do not have a copy of the Korn shell, you will not be able to use some of the commands discussed in this book. To obtain a copy of the Korn Shell you can contact the AT&T Toolchest Bulletin Board on (201) 974-8317 using a 300 or 1200 Baud modem.

The Korn shell is an enhanced version of the original Bourne shell. It adds such features as:

   aliasing
   functions (later versions of the sh support functions)
   command re-entry of commands stored in history file
   in-line editing of history file
   job control (only on systems that support job control)
   tilde substitution
   enhanced variable substitution
   arithmetic expression evaluation
   automatic field padding
   filename completion

C Shell
The C shell is also an enhanced version of the Bourne shell. It was originally written in the late 70s and early 80s. The emphasis was to provide a better interactive shell. The command language was designed to resemble the syntax of the C programming language. The C shell added such features as:
   aliasing
   functions
   command re-entry of commands stored in history file
   in-line editing of history file
   job control (only on systems that support job control)
   tilde substitution
   enhanced variable substitution
   arithmetic expression evaluation
   automatic field padding
The C shell became a popular interactive shell, providing a superior interface alternative to the Bourne shell. It also provided the ground work for the Korn shell.

Discussing the shell is sometimes very confusing. In general UNIX terminology shell program, a shell, shell procedure, shell script, or script refer to a shell program. In this book the term shell script will be used to refer to a program written in the shell language.

Because the shell is a large and complex program it has been divided into subsections. Some of these subsections have been made into modules and are not included in this module. Most of the built-in commands have been placed in a module of their own for easy reference. Built-in commands are internal shell commands as compared to external UNIX commands that execute as a separate process. An internal command does not spawn a new process when it is executed.

As you read this module you may find it beneficial to read the module for a specific section, then return to this module to continue the learning sequence.

DEFINITIONS

A blank is a tab or space. A word is a contiguous set of characters , no blanks allowed. If a tab or space is quoted, then it is no longer a blank; it is a word . A name is a sequence of digits, letters , or underscores that begins with a letter or underscore . Refer to the Special (Meta)Characters section that follows , and to Module 23, the section Shell Command Syntax.


Previous Table of Contents Next

Copyright Wordware Publishing, Inc.


Illustrated UNIX System V
Illustrated Unix System V/Bsd
ISBN: 1556221878
EAN: 2147483647
Year: N/A
Pages: 144
Authors: Robert Felps

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net