HP-UX Reference (11i v1 05/09) - 1 User Commands N-Z (vol 2)
s
sh-bourne(1) sh-bourne(1)
? The decimal value returned by the last synchronously executed command.
$ The process id of the last separately-invoked shell (i.e., a shell arising from direct
invocation or #!). This parameter is not updated for subshells arising from
(), com-
mand substitution, etc.
! The process number of the last background command invoked.
LINES
COLUMNS
The number of lines and columns in the current display area. These parameters are
set only under specific circumstances. See Signals.
The following parameters are used by the shell:
HOME The default argument (home directory) for the
cd command.
PATH The search path for commands (see ‘‘Execution’’ below). Users executing under
rsh
cannot change PATH.
CDPATH The search path for the cd
command.
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 the arrival of mail in the specified file.
MAILCHECK This parameter specifies how often (in seconds) the shell will check for the arrival of
mail in the files specified by the
MAILPATH or MAIL parameters. The default value
is 600 seconds (10 minutes). If set to 0, the shell checks before each prompt.
MAILPATH A colon (:)-separated list of file names. If this parameter is set, the shell informs the
user of the arrival of mail in any of the specified files. Each file name can be followed
by % and a message to be printed when the modification time changes. The default
message is you have mail.
PS1 Primary prompt string, by default ‘‘$ ’’.
PS2 Secondary prompt string, by default ‘‘> ’’.
IFS Internal field separators, normally space, tab, and new-line.
SHACCT If this parameter is set to the name of a file writable by the user, the shell writes an
accounting record in the file for each shell procedure executed. Accounting routines
such as acctcom(1M) and acctcms(1M) can be used to analyze the data collected.
SHELL When the shell is invoked, it scans the environment (see ‘‘Environment’’ below) for
this name. If it is found and there is an r in the file name part of its value, the shell
becomes a restricted shell. SHELL is also used by some processors to determine
which command interpreter to run.
The shell gives default values to PATH, PS1, PS2, MAILCHECK, and IFS.
HOME and MAIL are set by
login(1).
Blank Interpretation
After parameter and command substitution, the results of substitution are scanned for internal field
separator characters (those found in
IFS) and split into distinct arguments where such characters are
found. Explicit null arguments ("" or ’’) are retained. Implicit null arguments (those resulting from
parameters that have no values) are removed.
File Name Generation
Following substitution, each command word is processed as a pattern for file name expansion. The form of
the patterns is the Pattern Matching Notation defined by regexp(5).
Quoting
The following characters have a special meaning to the shell and cause termination of a word unless
quoted:
;, &, (, ), |, ˆ, <, >, new-line, space, tab, # (comment)
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 (’’), except a single quote, are
quoted. Inside double quote marks (""), parameter and command substitution occurs and \ quotes the
characters \, `, ", and $. "$*" is equivalent to "$1 $2 ...", whereas "$@" is equivalent to "$1""$2"
Section 1−−884 Hewlett-Packard Company − 3 − HP-UX 11i Version 1: September 2005