Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

sh(1) OSS Shell and Utilities Reference Manual
NAME
sh - Describes the OSS shell
SYNOPSIS
sh [-i][-c command_string | -s][+ | -abCefmnosuvx][+ | -o][option ...] | [argument ...] |
[le][argument ...]
The OSS shell is an interactive command interpreter and a command programming language.
The OSS shell is based on the UNIX Korn shell.
FLAGS
-c command_string
Causes sh to read commands from command_string.
-i Causes sh to run as an interactive shell. The SIGTERM signal is thus ignored, and the
SIGINT signal is caught, causing the current command to be terminated and a new
prompt to be output.
-r Causes sh to run as a restricted shell.
-s Causes sh to read commands from standard input. If you do not specify the -c ag or
do not specify any arguments to sh other than ags, sh automatically invokes the -s
ag. The -c ag overrides the -s ag, however.
The rest of the ags that can be used with sh are described under the set subcommand, in the sub-
section Special sh Commands.
DESCRIPTION
ksh is an alias for sh.
The OSS shell carries out commands either interactively from a terminal keyboard or from a le.
Some important features of the OSS shell are as follows:
Command aliasing
Filename substitution
Tilde substitution
Command substitution
Parameter substitution
Job control
Inline editing
A le from which the shell carries out commands is usually called a shell script,ashell pro-
cedure,oracommand le.
A simple command is a sequence of words separated by spaces or tabs. A word is a sequence of
characters that contains no unquoted spaces or tabs. The rst word in the sequence (numbered as
0) usually species the name of a command. Any remaining words, with a few exceptions, are
passed to that command. A space refers to both spaces and tabs.
The value of a simple command is its exit value if it ends normally or (octal) 200 added to the
signal number if it terminates due to a signal. For a list of status values, see the signal() system
call.
A pipeline is a sequence of one or more commands separated by a | (vertical bar). In a pipeline,
the standard output of each command becomes the standard input of the next command. Each
818 Hewlett-Packard Company 527188-007