Command Reference Guide

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1/!!!intro.1
________________________________________________________________
___ ___
k
ksh(1) ksh(1)
MAIL If this parameter is set to the name of a mail file and the MAILPATH parameter is
not set, the shell informs the user of arrival of mail in the specified file.
MAILCHECK This variable specifies how often (in seconds) the shell checks for changes in the
modification time of any of the files specified by the MAILPATH or MAIL parame-
ters. The default value is 600 seconds. When the time has elapsed the shell checks
before issuing the next prompt.
MAILPATH A list of file names separated by colons (:). If this parameter is set, the shell informs
the user of any modifications to the specified files that have occurred within the last
MAILCHECK seconds. Each file name can be followed by a ? and a message to be
printed, in which case the message undergoes parameter and command substitution
with the parameter $_ defined as the name of the changed le. The default message
is you have mail in $_.
PATH The search path for commands (see Execution below). The user cannot change PATH
if executing rksh (except in the .profile file).
PS1 The value of this parameter is expanded for parameter substitution, to define the pri-
mary prompt string which, by default, is $ followed by a space character. The char-
acter ! in the primary prompt string is replaced by the command number (see Com-
mand Re-entry below). To include a ! in the prompt, use
!!.
PS2 Secondary prompt string, by default > followed by a space character.
PS3 Selection prompt string used within a select loop, by default
#? followed by a
space character.
PS4 The value of this variable is expanded for parameter substitution and precedes each
line of an execution trace. If
PS4 is unset, the execution trace prompt is + followed
by a space character.
SHELL The path name of the shell is kept in the environment. When invoked, the shell is
restricted if the value of this variable contains an
r in the basename.
TMOUT If set to a value greater than zero, the shell terminates if a command is not entered
within the prescribed number of seconds after issuing the
PS1 prompt.
VISUAL Invokes the corresponding option when the value of this variable ends in emacs,
gmacs,orvi (see
set in Special Commands below).
The shell gives default values to PATH, PS1, PS2, MAILCHECK, TMOUT, and
IFS. HOME, SHELL, ENV,
and
MAIL are never set automatically by the shell (although
HOME, SHELL, and MAIL are set by
login(1)).
Blank Interpretation
After parameter and command substitution, the results of substitution are scanned for field separator char-
acters (found in
IFS), and split into distinct arguments where such characters are found. ksh retains
explicit null arguments ( or
’’) but removes implicit null arguments (those resulting from parameters that
have no values).
File Name Generation
Following substitution, each command word is processed as a pattern for file name expansion unless the
-f option has been set. The form of the patterns is the Pattern Matching Notation defined by regexp(5).
The word is replaced with sorted file names matching the pattern. If no file name is found that matches
the pattern, the word is left unchanged.
In addition to the notation described in regexp(5), ksh recognizes composite patterns made up of one or
more pattern lists separated from each other with a |. Composite patterns can be formed with one or more
of the following:
?(pattern-list) Optionally matches any one of the given patterns.
*(pattern-list) Matches zero or more occurrences of the given patterns.
+(pattern-list) Matches one or more occurrences of the given patterns.
@(pattern-list) Matches exactly one of the given patterns.
!(pattern-list) Matches anything, except one of the given patterns.
Quoting
Each of the metacharacters listed above (See Definitions above) has a special meaning to the shell and
causes termination of a word unless quoted. A character can be quoted (i.e., made to stand for itself) by
preceding it with a
\. The pair \new-line is ignored. All characters enclosed between a pair of single quote
marks (’’), are quoted. A single quote cannot appear within single quotes. Inside double quote marks
HP-UX Release 11i: December 2000 6 Section 1401
___
___