HP-UX Reference (11i v1 05/09) - 1 User Commands A-M (vol 1)

k
ksh(1) ksh(1)
The following parameters are set automatically by the shell:
# The number of positional parameters in decimal.
- Options supplied to the shell on invocation or by the
set command.
? The decimal value returned by the last executed command.
$ The process number of this shell.
_ Initially, the value of _ is an absolute pathname 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 check-
ing for mail.
! The process number of the last background command invoked.
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. In a windowed environment, if the
shell detects that the window size has changed, the shell updates the value of
COLUMNS.
ERRNO The value of errno as set by the most recently failed system call. This value is sys-
tem dependent and is intended for debugging purposes.
LINENO The line number of the current line within the script or function being executed.
LINES If this variable is set, the value is used to determine the column length for printing
select lists. select lists print vertically until about two-thirds of LINES lines
are filled. In a windowed environment, if the shell detects that the window size has
changed, the shell updates the value of LINES.
OLDPWD The previous working directory set by the cd command.
OPTARG The value of the last option argument processed by the getopts special command.
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 initial-
ized by assigning a numeric value to RANDOM.
REPLY This parameter is set by the select statement and by the read special command
when no arguments are 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.
EDITOR If the value of this variable ends in emacs, gmacs,or vi and the
VISUAL variable
is not set, the corresponding option is turned on (see
set in Special Commands
below).
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 Invoking ksh
below). 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. 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 environment.
IFS Internal field separators, normally space, tab, and new-line that are used to separate
command words resulting from command or parameter substitution, and for separat-
ing words with the special command read. The first character of the IFS parame-
ter is used to separate arguments for the "$*" substitution (see Quoting below).
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 has appropriate privileges and no HISTFILE
is given, then no history file is used (see Command Re-entry below).
HISTSIZE If this parameter is set when the shell is invoked, the number of previously entered
commands accessible to this shell will be greater than or equal to this number. The
default is 128.
HOME The default argument (home directory) for the cd command.
Section 1414 Hewlett-Packard Company 5 HP-UX 11i Version 1: September 2005