HP-UX Reference (11i v1 00/12) - 1 User Commands N-Z (vol 2)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1/neqn.1
________________________________________________________________
___ ___
s
sh-posix(1) sh-posix(1)
SHELL The path name of the shell is kept in the environment. When invoked, the shell is res-
tricted if the value of this variable contains an r in the base name.
TMOUT If set to a value greater than zero, the shell will terminate if a command is not entered
within the prescribed number of seconds after issuing the PS1 prompt. (Note that the shell
can be compiled with a maximum bound for this value which cannot be exceeded.)
VISUAL Invokes the corresponding option when the value of this variable ends in emacs, gmacs,
or vi. See the set -o special command.
The shell gives default values to IFS, MAILCHECK, PATH, PS1, PS2, and TMOUT. On the other hand,
MAIL, ENV, HOME, and SHELL are never set automatically by the shell (although HOME, MAIL, and
SHELL are set by login; see login(1)).
Blank Interpretation
After parameter and command substitution, the results of substitution are scanned for field separator char-
acters (defined in IFS), and split into distinct arguments when such characters are found. sh retains
explicit null arguments ("" or ’’) but removes implicit null arguments (those resulting from parameters
that have null values).
File Name Generation
Following substitution, each command word is processed as a pattern for file name expansion unless expan-
sion has been disabled with the
set -f special command. The form of the patterns is the Pattern Match-
ing Notation defined in 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), sh 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) 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 (see the "Definitions" subsection) has a special meaning to the shell and ter-
minates a word unless quoted. A character may be quoted (that is, made to stand for itself) by preceding
it with a backslash (\). The pair \newline is ignored; the current and following lines are concatenated.
All characters enclosed between a pair of apostrophes (...) are quoted. An apostrophe cannot appear
within apostrophes.
Parameter and command substitution occurs inside quotation marks ("..."). \ quotes the characters \, ,
", and $.
Inside grave accent marks (...), \ quotes the characters \, , and $. If the grave accents occur within
quotation marks, \ also quotes the character ".
The meanings of $* and $@ are identical when not quoted or when used as a parameter assignment value
or as a file name. However, when used as a command argument, "$*" is equivalent to
"$1d$2d...",
whereas
"$@" is equivalent to "$1"d"$2"d... (where d is the first character of
IFS),
The special meaning of keywords or aliases can be removed by quoting any character of the name. The
recognition of function names or special command names cannot be altered by quoting them.
Arithmetic Evaluation
Integer arithmetic is provided with the special command
let. Evaluations are performed using long
integer arithmetic. Constants take the form base#n or n, where base is a decimal number between two
and thirty-six representing the arithmetic base and n is a number in that base. If base# is omitted, base 10
is used.
An arithmetic expression uses the same syntax, precedence, and associativity of expression as the C
language. All the integral operators, other than ++, --, ?:, and , are supported. Variables can be refer-
enced by name within an arithmetic expression without using the parameter substitution syntax. When a
variable is referenced, its value is evaluated as an arithmetic expression.
Section 1860 16 HP-UX Release 11i: December 2000
___
___