The members of the $PIPESTATUS array hold the exit status of each respective command executed
in a pipe. $PIPESTATUS[0] holds the exit status of the first command in the pipe,
$PIPESTATUS[1] the exit status of the second command, and so on
$PPID
The $PPID of a process is the process ID (pid) of its parent process. [42]
Compare this with the pidof command.
$PROMPT_COMMAND
A variable holding a command to be executed just before the primary prompt, $PS1 is to be
displayed.
$PS1
This is the main prompt, seen at the command-line.
$PS2
The secondary prompt, seen when additional input is expected. It displays as ">".
$PS3
The tertiary prompt, displayed in a select loop (see Example 11-29).
$PS4
The quartenary prompt, shown at the beginning of each line of output when invoking a script with the
-x option. It displays as "+".
$PWD
Working directory (directory you are in at the time)
$REPLY
The default value when a variable is not supplied to read. Also applicable to select menus, but only
supplies the item number of the variable chosen, not the value of the variable itself.
$SECONDS
The number of seconds the script has been running.
$SHELLOPTS
The list of enabled shell options, a readonly variable.
$SHLVL
Shell level, how deeply Bash is nested. [43] If, at the command-line, $SHLVL is 1, then in a script it
will increment to 2.
$TMOUT
If the $TMOUT environmental variable is set to a non-zero value time, then the shell prompt will
time out after $time seconds. This will cause a logout.
$UID
User ID number
Current user's user identification number, as recorded in /etc/passwd
This is the current user's real id, even if she has temporarily assumed another identity through su.
$UID is a readonly variable, not subject to change from the command line or within a script, and is
the counterpart to the id builtin.
$0, $1, $2, etc.
Positional parameters, passed from command line to script, passed to a function, or set to a variable
(see Example 4-5 and Example 15-16)
$#
Number of command-line arguments [44] or positional parameters (see Example 36-2)
$*
All of the positional parameters, seen as a single word
"$*" must be quoted.
$@
Same as $*, but each parameter is a quoted string, that is, the parameters are passed on intact, without
interpretation or expansion. This means, among other things, that each parameter in the argument list
is seen as a separate word.
The $@ and $* parameters differ only when between double quotes.