Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
User Commands (k - l) ksh(1)
expression1 -ne expression2
TRUE, if expression1 is not equal to expression2.
expression1 -lt expression2
TRUE, if expression1 is less than expression2.
expression1 -gt expression2
TRUE, if expression1 is greater than expression2.
expression1 -le expression2
TRUE, if expression1 is less than or equal to expression2.
expression1 -ge expression2
TRUE, if expression1 is greater than or equal to expression2.
A compound expression can be constructed from these primitives by using any of the following,
listed in decreasing order of precedence.
(expression)
TRUE, if expression is TRUE. Used to group expressions.
! expression
TRUE if expression is FALSE.
expression1 && expression2
TRUE, if expression1 and expression2 are both TRUE.
expression1 || expression2
TRUE, if either expression1 or expression2 is TRUE.
Input/Output
Before a command is executed, you can redirect its input and output by using a special notation
interpreted by the shell. The following can appear anywhere in a simple command or can pre-
cede or follow a command and are not passed on to the invoked command. Command and
parameter substitution occurs before word or digit is used, except as noted in the following text.
Filename generation occurs only if the pattern matches a single file and interpretation of spaces
is not performed.
<word Use file word as standard input (file descriptor 0).
>word Use file word as standard output (file descriptor 1). If the file does not exist, it is
created. If the file exists, and the noclobber option is on, this causes an error; other-
wise, it is truncated to 0 (zero) length.
>|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
527188-003 Hewlett-Packard Company 5−19