UNIX for OpenVMS Users, Second Edition

Section 10.9: Built-in Shell Commands

10.9 Built-in Shell Commands

Within your shell of choice, you need not worry about the distinction between built-in shell commands and separate programs called by the shell. However, C shell users who invoke the Bourne or Korn shells, or Korn and Bourne shell users who invoke the C shell, will discover that some familiar commands are not available. Some built-in shell commands that we have already discussed are dirs, pushd, and popd for manipulating the directory stack; fg, bg, and jobs for background processing; at, kill, and nice for affecting processes; shift, alias, export, and integer for controlling variables; and history for reviewing the history list.

We now introduce several new built-in shell commands particularly useful in shell programming: onintr and trap, which redirect the control of a script when an interrupt is issued; eval, which executes a command built from variables, that is, it forces the current process to interpret any shell metacharacters before performing the variable substitution; time, which determines the execution time and elapsed (wall clock) time of a command or shell script; and . (dot) and source, which force the execution of commands or shell scripts by the parent shell.

10.9.1 onintr (C Shell) and trap (Korn Shell)

The C shell command onintr, and the Korn shell command trap, redirect the flow of a script following certain conditions. The C shell onintr mechanism is...

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: Military (MIL-SPEC) Connectors
Finish!
Privacy Policy

This is embarrasing...

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