From b7917bf7128c7bef363ba88c1f5fea22d02d6ae4 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 22 Jan 2019 22:02:53 +0100 Subject: [PATCH] README: improve wording an provide a more robust example of use --- README | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/README b/README index 9edbbaf..edde33c 100644 --- a/README +++ b/README @@ -1,27 +1,30 @@ bash_prompt is a collection of custom bash prompts to be loaded using the provided `set_prompt` function. -Example of use, with bash_prompt under ~/.bash/: +Example of use, assuming that bash_prompt is under ~/.bash/: # load git prompt support [ -f /usr/lib/git-core/git-sh-prompt ] && . /usr/lib/git-core/git-sh-prompt # load function to set custom shell prompts - [ -f ~/.bash/bash_prompt/set_prompt ] && . ~/.bash/bash_prompt/set_prompt - - # set a different prompt for the root user - if [ $UID -eq 0 ]; + if [ -f ~/.bash/bash_prompt/set_prompt ]; then - set_prompt fire - else - set_prompt iceg + . ~/.bash/bash_prompt/set_prompt + + # set a different prompt for the root user + if [ $UID -eq 0 ]; + then + set_prompt fire + else + set_prompt iceg + fi fi The prompts can contain backslash-escaped special characters as specified in the bash(1) man page, or any ANSI escape sequences as described in the console_codes(4) man page. -The `set_prompt` function provides symbolic constant for the most used escape +The `set_prompt` function defines symbolic constants for the most used escape sequences, see the source code for the details. Inspired by bashish: http://bashish.sourceforge.net/ -- 2.1.4