| Start | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Using the PROMPT_COMMAND envrionment variable When the last command in an interactive bash instance is done, the evaluated PS1 variable is displayes. Before actually displaying PS1 bash looks whether the PROMPT_COMMAND is set. This value of this var must be a callable program or script. If this var is set this program/script is called BEFORE the PS1 prompt is displayed. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Using PS2 PS2 is displayed when a command extends to more than one line and bash awaits more keystrokes. It is displayed too when a compound command like while...do..done and alike is entered. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Using PS3 When the select statement is executed, it displays the given items prefixed with a number and then displays the PS3 prompt: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Using PS4 PS4 is displayes when bash is in debugging mode. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Using PS1 PS1 is the normal system prompt indicating that bash waits for commands being typed in. It understands some escape sequences and can execute functions or progams. As bash has to position the cursor after the displayes prompt, it needs to know how to calculate the effective length of the prompt string. To indicate non printing sequences of chars within the PS1 variable escaped braces are used: [ a non printing sequence of chars ]. All being said holds true for all PS* vars. (The black caret indicates cursor) Syntax
Parameters
|
Read Article
https://develop.horje.com/learn/1434/reference