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

ksh(1) OSS Shell and Utilities Reference Manual
>|word Same as >, except that it overrides the noclobber option.
>>word Use file word as standard output. If the file exists, output is appended to it (by first
seeking to the End-of-File); otherwise, the file is created.
<>word Open file 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 filename 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 first 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 file 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 file descriptor number referred
to is that specified by the digit (instead of the default 0 or 1). For example:
... 2>&1
means file descriptor 2 is to be opened for writing as a duplicate of file descriptor 1.
The order in which redirections are specified is significant. The shell evaluates each redirection
in terms of the (file descriptor, file) association at the time of evaluation. For example:
... 1>fname >&1
first associates file descriptor 1 with file fname. It then associates file descriptor 2 with the file
associated with file descriptor 1 (that is, fname). If the order of redirections is reversed, file
descriptor 2 is associated with the terminal (assuming file descriptor 1 is) and then file descriptor
1 is associated with file 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 file. Otherwise, the environment for the execution of a com-
mand contains the file descriptors of the invoking shell as modified by input/output
specifications.
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 identifiers 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 modified by the
current shell, plus any additions that must be noted in the export or typeset -x commands.
520 Hewlett-Packard Company 527188-021