Changes between Version 9 and Version 10 of Wisdom/Bash


Ignore:
Timestamp:
09/08/11 12:05:21 (15 years ago)
Author:
adrn@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Wisdom/Bash

    v9 v10  
    99=== Tips and Tricks ===
    1010
    11 I like to change the color, and structure, of my Bash prompt to make a more clear distinction between the area that I am typing and the prompt. A typical Bash prompt looks like {{{user@machine:present working directory$ }}} (see: [/attachment/wiki/Wisdom/Bash/bash_prompt_default.png image]). A stylized prompt could look like [/attachment/wiki/Wisdom/Bash/bash_prompt_color.png this].
     11I like to change the color, and structure, of my Bash prompt to make a more clear distinction between the area that I am typing and the prompt. A typical Bash prompt looks like {{{user@machine:present working directory$ }}} (see: [/attachment/wiki/Wisdom/Bash/bash_prompt_default.png image]). A stylized prompt could look like [/attachment/wiki/Wisdom/Bash/bash_prompt_color.png this]. You can change the structure (where to put the machine name, user name, path) and the color of each element. My {{{.prompt}}} file defines all of the colors, and shows and example structure:
     12{{{
     13COL_BLACK=$'\[\033[30m\]'
     14COL_RED=$'\[\033[31m\]'
     15COL_GREEN=$'\[\033[32m\]'
     16COL_YELLOW_ORANGE=$'\[\033[33m\]'
     17COL_BLUE=$'\[\033[34m\]'
     18COL_MAGENTA=$'\[\033[35m\]'
     19COL_CYAN=$'\[\033[36m\]'
     20COL_NORM=$'\[\033[39m\]'
     21PMPT_BOLD=$'\[\033[1m\]'
     22PMPT_NORM=$'\[\033[0m\]'
     23
     24# See: http://networking.ringofsaturn.com/Unix/Bash-prompts.php
     25# for a longer list of colours.
     26
     27PS1="${PMPT_BOLD}${COL_CYAN}\h${COL_YELLOW_ORANGE} [\w] %${PMPT_NORM} "
     28}}}
    1229
    1330=== "Style" ===