HP-UX Reference (11i v1 05/09) - 1 User Commands N-Z (vol 2)
s
sh-posix(1) sh-posix(1)
1, 2, ... The positional parameters.
*, @ All the set positional parameters, separated by a field separator character. See the "Quot-
ing" subsection.
# The number of set positional parameters in decimal.
- Flags supplied to the shell on invocation or by the
set command.
? The decimal exit status returned by the last executed command.
$ The process number of this shell.
_ Initially, the absolute path name of the shell or script being executed, as passed in the
environment. Subsequently, it is assigned the last argument of the previous command.
This parameter is not set for commands which are asynchronous. This parameter is also
used to hold the name of the matching
MAIL file when checking for mail.
! The process number of the last background command invoked.
ERRNO The value of errno as set by the most recently failed system call. This value is system-
dependent and is intended for debugging purposes.
LINENO The line number of the current line within the script or function being executed.
OLDPWD The previous working directory set by the cd command.
OPTARG The value of the last option argument processed by the getopts special command.
OPTERR If set to 0, OPTERR will suppress error messages from the getopts special command.
OPTERR is initially set to 1.
OPTIND The index of the last option argument processed by the getopts special command.
PPID The process number of the parent of the shell.
PWD The present working directory set by the cd command.
RANDOM Each time this parameter is evaluated, a random integer, uniformly distributed between 0
and 32767, is generated. The sequence of random numbers can be initialized by assigning a
numeric value to RANDOM.
REPLY Set by the select compound command, and by the read special command when no
name is supplied.
SECONDS Each time this parameter is referenced, the number of seconds since shell invocation is
returned. If this parameter is assigned a value, the value returned upon reference is the
value that was assigned plus the number of seconds since the assignment.
• The following parameters are used by the shell:
CDPATH The search path for the cd command, a list of directories separated by colons.
COLUMNS If this variable is set, its value is used to define the width of the edit window for the shell
edit modes and for printing select lists.
EDITOR If the value of this variable ends in emacs, gmacs,orvi and the VISUAL variable is not
set, the corresponding option is turned on (see the set special command.
ENV If this parameter is set, parameter substitution is performed on the value to generate the
path name of the script to be executed when the shell is invoked (see the "Invocation" sub-
section). This file is typically used for alias and function definitions.
FCEDIT The default editor name for the fc command.
FPATH The search path for function definitions, a list of directories separated by colons. This path
is searched when a function with the -u attribute is referenced and when a command is not
found. If an executable file is found, then it is read and executed in the current environ-
ment.
HISTFILE If this parameter is set when the shell is invoked, its value is the path name of the file that
is used to store the command history. The default value is $HOME/.sh_history.If
the user is a superuser and no HISTFILE is given, then no history file is used. See the
"Command Reentry" subsection and the WARNINGS section.
HP-UX 11i Version 1: September 2005 − 14 − Hewlett-Packard Company Section 1−−905