The following parameters are automatically set 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 checking for mail.  While defining a compound variable or a type, _ is initialized as a reference to the compound variable or type.  When a discipline function is invoked, _ is initialized as a reference to the variable associated with the call to this function.  Finally when _ is used as the name of the first variable of a type definition, the new type is derived from the type of the first variable (See Type Variables  below.). !      The process id or the pool name and job number of the last background command invoked or the most recent job put in the background with the bg built-in command.  Background jobs started in a named pool will be in the form pool.number where pool is the pool name and number is the job number within that pool. .sh.command When processing a DEBUG trap, this variable contains the current command line that is about to run. .sh.edchar This variable contains the value of the keyboard character (or sequence of characters if the first character is an ESC, ascii 033) that has been entered when processing a KEYBD trap (see Key Bindings below).  If the value is changed as part of the trap action, then the new value replaces the key (or key sequence) that caused the trap. .sh.edcol The character position of the cursor at the time of the most recent KEYBD trap. .sh.edmode The value is set to ESC when processing a KEYBD trap while in vi insert mode.  (See Vi Editing Mode  below.) Otherwise, .sh.edmode is null when processing a KEYBD trap. .sh.edtext The characters in the input buffer at the time of the most recent KEYBD trap.  The value is null when not processing a KEYBD trap. .sh.file The pathname of the file than contains the current command. .sh.fun The name of the current function that is being executed. .sh.level Set to the current function depth.  This can be changed inside a DEBUG trap and will set the context to the specified level. .sh.lineno Set during a DEBUG trap to the line number for the caller of each function. .sh.match An indexed array which stores the most recent match and sub-pattern matches after conditional pattern matches that match and after variables expansions using the operators #, %, or /.  The 0-th element stores the complete match and the i-th.  element stores the i-th submatch.  For // the array is two dimensional with the first subscript indicating the most recent match and sub-pattern match and the second script indicating which match with 0 representing the first match.  The .sh.match variable becomes unset when the variable that has expanded is assigned a new value. .sh.math Used for defining arithmetic functions (see Arithmetic evaluation below).  and stores the list of user defined arithmetic functions. .sh.name Set to the name of the variable at the time that a discipline function is invoked. .sh.op_astbin The directory where several shell built-in commands are bound to.  The default is /opt/ast/bin.  When the value is /bin, then builtins will be bound to /bin or /usr/bin depending on where the executable is found.  This variable can be set by including it in the SH_OPTIONS variable. .sh.pgrp The current process group of this shell. .sh.pwdfd The file descriptor number for the present working directory. .sh.sig Set when executing a trap to the information contained in the siginfo_t structure (See siginfo(2) for a description of this structure.) .sh.subscript Set to the name subscript of the variable at the time that a discipline function is invoked. .sh.subshell The current depth for subshells and command substitution. .sh.value Set to the value of the variable at the time that the set or append discipline function is invoked.  When a user defined arithmetic function is invoked, the value of .sh.value is saved and .sh.value is set to long double precision floating point.  .sh.value is restored when the function returns. .sh.version Set to a value that identifies the version of this shell. KSH_VERSION A name reference to .sh.version. LINENO The current line number 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 built-in command. OPTIND The index of the last option argument processed by the getopts built-in 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 variable is referenced, 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  This variable is set by the select statement and by the read built-in command when no arguments are supplied. SECONDS Each time this variable is referenced, the number of seconds since shell invocation is returned.  If this variable is assigned a value, then the value returned upon reference will be the value that was assigned plus the number of seconds since the assignment. SHLVL  An integer variable the is incremented each time the shell is invoked and is exported.  If SHLVL is not in the environment when the shell is invoked, it is set to 1.