sh-posix.1 (2010 09)

s
sh-posix(1) sh-posix(1)
Setting the value of SHELL,
ENV,orPATH
Specifying path or command names containing
/
Redirecting output (>, >|,
<>, and >>)
The restrictions above are enforced after the
.profile
and ENV files are interpreted.
When a command to be executed is found to be a shell procedure,
rsh invokes sh to execute it. Thus, the
end-user is provided with shell procedures accessible to the full power of the standard shell, while being
restricted to a limited menu of commands. This scheme assumes that the end-user does not have write
and execute permissions in the same directory.
These rules effectively give the writer of the
.profile file complete control over user actions, by per-
forming guaranteed set-up actions and leaving the user in an appropriate directory (probably not the
login directory).
The system administrator often sets up a directory of commands (usually
/usr/rbin) that can be safely
invoked by
rsh. HP-UX systems provide a restricted editor
red (see ed(1)), suitable for restricted users.
Definitions
metacharacter One of the following characters:
;&()|<>newline space tab
blank A tab or a space.
identifier A sequence of letters, digits, or underscores starting with a letter or underscore.
Identifiers are used as names for functions and named parameters.
word A sequence of characters separated by one or more nonquoted metacharacters.
command A sequence of characters in the syntax of the shell language. The shell reads each
command and carries out the desired action, either directly or by invoking separate
utilities.
special command A command that is carried out by the shell without creating a separate process.
Except for documented side effects, most special commands can be implemented as
separate utilities.
# Comment delimiter. A word beginning with # and all following characters up to a
newline are ignored.
parameter An identier, a decimal number, or one of the characters
!, #
, $, *, -, ?, @, and _.
See the Parameter Substitution subsection.
named parameter A parameter that can be assigned a value. See the Parameter Substitution subsec-
tion.
variable A parameter.
environment variable
A parameter that is known outside the local shell, usually by means of the
export special command.
Commands
A command can be a simple command that executes an executable file, a special command that executes
within the shell, or a compound command that provides flow of control for groups of simple, special, and
compound commands.
Simple Commands
A simple command is a sequence of blank-separated words that may be preceded by a parameter assign-
ment list. (See the Environment subsection). The first word specifies the name of the command to be exe-
cuted. Except as specified below, the remaining words are passed as arguments to the invoked command.
The command name is passed as argument
0 (see exec(2)). The value of a simple command is its exit
status if it terminates normally, or 128+errorstatus if it terminates abnormally (see signal (5) for a list of
errorstatus values).
A pipeline is a sequence of one or more commands separated by a bar (
|) and optionally preceded by an
exclamation mark (!). The standard output of each command but the last is connected by a pipe (see
pipe (2)) to the standard input of the next command. Each command is run as a separate process; the
shell waits for the last command to terminate. If ! does not precede the pipeline, the exit status of the
pipeline is the exit status of the last command in the pipeline. Otherwise, the exit status of the pipeline is
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010