UNIX for OpenVMS Users, Third Edition

Chapter 10: Shell Programming

Overview

Civilization advances by extending the number of important operations that can be performed without thinking of them.

Alfred North Whitehead

Shell programming involves grouping together a number of shell commands and constructs into a file (called a shell script) to perform a routine task. The analog in OpenVMS is the creation of a DCL command procedure. If you are versed in DCL command procedures, you should be aware that achieving equivalent functionality in UNIX requires becoming adept at writing shell scripts. The syntax of a shell script varies according to the shell in use; in this chapter, we will give examples of C shell (csh), Bourne-Again shell (bash), and Korn shell (ksh) syntax. The Korn shell is an extension of the original Bourne shell (sh), adding interactive convenience features; bash likewise extends Bourne shell functionality while also borrowing liberally from csh. It is important to note that a shell script written using just sh syntax and features should be executable under ksh or bash without modification. In contrast, only the simplest csh scripts would be compatible with sh or ksh and, to a slightly greater extent, bash. Another shell, tcsh, is an extension of the C shell.

Since the man pages are terse, this chapter explains a few features of shell programming in greater detail. For more than the basics though, you should invest in a book dedicated to the shell you plan to use. The following comparisons will help to orient the OpenVMS user to shell programming in...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Heat Exchangers
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.