See the man page bash(1) § PROMPTING or the Bash reference manual for a complete list of escape sequences.Īside from the escape characters recognized by Bash, most terminals recognize special escape sequences that affect the terminal itself rather than printing characters. So a PS1 of '\A \u $ ' would be printed like 17:35 username $. For example, \u is expanded into the current username and \A is expanded to the current time. When printing the prompt string, Bash looks for certain backslash-escaped characters and will expand them into special strings. While one can simply set their prompt to a plain string, there are a variety of techniques for making the prompt more dynamic and useful. The first character is repeated to indicate deeper levels.Īll of the prompts are customized by setting the corresponding variable to the desired string (usually in ~/.bashrc), for example It is displayed when debugging bash scripts to indicate levels of indirection. Usually you would customize it in the script where the select is used rather than in your. Unlike the other prompts, it does not expand Bash escape sequences. It is the prompt displayed for Bash's select built-in which displays interactive menus.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |