Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)

User Commands (s) sh(1)
NAME
sh - Describes the OSS shell
SYNOPSIS
sh [-i][-c command_string | -s][+ | -abCefmnosuvx][+ | -o][option ...] | [argument ...] |
[file][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 flag or
do not specify any arguments to sh other than flags, sh automatically invokes the -s
flag. The -c flag overrides the -s ag, however.
The rest of the flags 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 file.
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 file from which the shell carries out commands is usually called a shell script,ashell pro-
cedure,oracommand file.
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 first word in the sequence (numbered as
0) usually specifies 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
527188-021 Hewlett-Packard Company 821