Prompt variable

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: