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

ksh(1) OSS Shell and Utilities Reference Manual
>|word Same as >, except that it overrides the noclobber option.
>>word Use le word as standard output. If the le exists, output is appended to it (by rst
seeking to the End-of-File); otherwise, the le is created.
<>word Open le word for reading and writing as standard input.
<<[-]word
The shell input is read up to a line that is the same as word, or to an End-of-File. No
parameter substitution, command substitution, or
lename generation is performed on
word. The resulting document, called a here document, becomes the standard input. If
any character of word is quoted, then no interpretation is placed upon the characters of
the document; otherwise, parameter and command substitution occurs, \newline is
ignored, and \ must be used to quote the characters \, $, , and the rst character of
word.If- is appended to <<, then all leading tabs are stripped from word and from the
document.
<&digit The standard input is duplicated from le descriptor digit (see dup(2)). The standard
output is duplicated using >& digit.
<&- The standard input is closed. The standard output is closed using >&-.
<&p The input from the coprocess (or background process) is moved to standard input.
>&p The output to the coprocess is moved to standard output.
If one of the preceding redirections is preceded by a digit, then the le descriptor number referred
to is that specied by the digit (instead of the default 0 or 1). For example:
... 2>&1
means le descriptor 2 is to be opened for writing as a duplicate of le descriptor 1.
The order in which redirections are specied is signicant. The shell evaluates each redirection
in terms of the (le descriptor, le) association at the time of evaluation. For example:
... 1>fname >&1
rst associates le descriptor 1 with le fname. It then associates le descriptor 2 with the le
associated with le descriptor 1 (that is, fname). If the order of redirections is reversed, le
descriptor 2 is associated with the terminal (assuming le descriptor 1 is) and then le descriptor
1 is associated with le fname.
If a command is followed by & and job control is not active, the default standard input for the
command is the empty /dev/null le. Otherwise, the environment for the execution of a com-
mand contains the le descriptors of the invoking shell as modied by input/output
specications.
Environment
The environment is a list of name-value pairs that is passed to an executed program in the same
way as a normal argument list. The names must be identiers and the values are character
strings. The shell interacts with the environment in several ways. On invocation, the shell scans
the environment and creates a parameter for each name found, giving it the corresponding value
and marking it export. Executed commands inherit the environment. If you modify the values
of these parameters or create new ones, using the export or typeset -x commands, they become
part of the environment. The environment used by any executed command is thus composed of
any name-value pairs originally inherited by the shell, whose values can be modied by the
current shell, plus any additions that must be noted in the export or typeset -x commands.
520 Hewlett-Packard Company 527188-007