variable

PROMPT_COMMAND

Execute configured commands before each primary prompt; use trusted functions. Actual prompt timing not tested.

Formal Syntax & Structure

bash syntaxbash
PROMPT_COMMAND=(function_name)

Return Value

context-dependent

Execute configured commands before each primary prompt; use trusted functions. Actual prompt timing not tested.

Working Example

Example Snippetbash
bm_prompt() { printf "ready\n"; }PROMPT_COMMAND=(bm_prompt)# Observe the next prompt in the private terminal.
Bash Reference