Chapter 5: Shell Variables

78

READLINE_LINE

The contents of the Readline line buffer, for use with ‘bind -x’ (see Section 4.2

[Bash Builtins], page 48).

READLINE_POINT

The position of the insertion point in the Readline line buffer, for use with ‘bind

-x’ (see Section 4.2 [Bash Builtins], page 48).

REPLY

The default variable for the read builtin.

SECONDS

This variable expands to the number of seconds since the shell was started.

Assignment to this variable resets the count to the value assigned, and the expanded value becomes the value assigned plus the number of seconds since the assignment.

SHELL

The full pathname to the shell is kept in this environment variable. If it is not set when the shell starts, Bash assigns to it the full pathname of the current user’s login shell.

SHELLOPTS

A colon-separated list of enabled shell options. Each word in the list is a valid argument for the -o option to the set builtin command (see Section 4.3.1 [The

Set Builtin], page 58). The options appearing in SHELLOPTS are those reported as ‘on’ by ‘set -o’. If this variable is in the environment when Bash starts up, each shell option in the list will be enabled before reading any startup files.

This variable is readonly.

SHLVL

Incremented by one each time a new instance of Bash is started. This is intended to be a count of how deeply your Bash shells are nested.

TIMEFORMAT

The value of this parameter is used as a format string specifying how the tim- ing information for pipelines prefixed with the time reserved word should be displayed. The ‘%’ character introduces an escape sequence that is expanded to a time value or other information. The escape sequences and their meanings are as follows; the braces denote optional portions.

%%

A literal ‘%’.

%[p][l]R

The elapsed time in seconds.

%[p][l]U

The number of CPU seconds spent in user mode.

%[p][l]S

The number of CPU seconds spent in system mode.

%P

The CPU percentage, computed as (%U + %S) / %R.

The optional p is a digit specifying the precision, the number of fractional digits after a decimal point. A value of 0 causes no decimal point or fraction to be output. At most three places after the decimal point may be specified; values of p greater than 3 are changed to 3. If p is not specified, the value 3 is used.

The optional l specifies a longer format, including minutes, of the form

MM mSS.FFs.

The value of p determines whether or not the fraction is included.

If this variable is not set, Bash acts as if it had the value