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
formatis passed to
strftime(3) and the result is inserted into the prompt string; an empty
formatresults in a locale-specific time representation. The braces are required.
$0(the portion following the final slash).
$HOMEabbreviated with a tilde (uses the
$HOMEabbreviated with a tilde.
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 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 The Shopt Builtin).
This can have unwanted side effects if escaped portions of the string
appear within command substitution or contain characters special to