[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The value of the variable PROMPT_COMMAND
is examined just before
Bash prints each primary prompt. If PROMPT_COMMAND
is set and
has a non-null value, then the
value is executed just as if it had been typed on the command line.
In addition, the following table describes the special characters which can appear in the prompt variables:
\a
\d
\e
\h
\H
\j
\l
\n
\r
\s
$0
(the portion
following the final slash).
\t
\T
\@
\A
\u
\v
\V
\w
\W
$PWD
.
\!
\#
\$
#
, otherwise $
.
\nnn
\\
\[
\]
The command number and the history number are usually different: the history number of a command is its position in the history list, which may include commands restored from the history file (see section 9.1 Bash History Facilities), while the command number is the position in the sequence of commands executed during the current shell session.
After the string is decoded, it is expanded via
parameter expansion, command substitution, arithmetic
expansion, and quote removal, subject to the value of the
promptvars
shell option (see section 4.2 Bash Builtin Commands).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |