The Bashrc Thread

Kasyx

Expert Member
Joined
Jun 6, 2006
Messages
2,565
Reaction score
1
Location
127.0.0.1
This is the thread in which you can post your bashrc file, give us an idea what sort of bash prompt customization you've got going.

You can check out my bashrc here.

If you're too lazy to click on a link, then here is the code for my bash prompt:

Code:
    function prompt {
    Black="\e[30m"
    Red="\e[31m"
    Green="\e[32m"
    LightGreen="\e[32;1m"
    Blue="\e[34m"
    LightBlue="\e[34;1m"
    NC="\e[0m" # No Color
    PS1="\[$LightGreen\033(0\154\033(B\][\[\033(0\161\161\033(B$Green\][\[$Red\]\u@\h\[$Green\]]\[\033(0\161\033(B\][\[$Red\]\w\[$Green\]]\[\033(0\161\033(B\][\[$Red\]\!\[$Green\]]\[\033(0\161\161\033(B\]]\n\[$LightGreen\033(0\155\161\033(B$Green\][\[$Red\]\#\[$Green\]]\[\033(0\161\033(B\][\[$Red\]\$\[$Green\]]\[\033(0\161\161\033(B\][\[$NC\]"
    PS2="> "
    }
    prompt

I showed you mine, you show me yours :D
 
This is the thread in which you can post your bashrc file, give us an idea what sort of bash prompt customization you've got going.

You can check out my bashrc here.

If you're too lazy to click on a link, then here is the code for my bash prompt:

Code:
    function prompt {
    Black="\e[30m"
    Red="\e[31m"
    Green="\e[32m"
    LightGreen="\e[32;1m"
    Blue="\e[34m"
    LightBlue="\e[34;1m"
    NC="\e[0m" # No Color
    PS1="\[$LightGreen\033(0\154\033(B\][\[\033(0\161\161\033(B$Green\][\[$Red\]\u@\h\[$Green\]]\[\033(0\161\033(B\][\[$Red\]\w\[$Green\]]\[\033(0\161\033(B\][\[$Red\]\!\[$Green\]]\[\033(0\161\161\033(B\]]\n\[$LightGreen\033(0\155\161\033(B$Green\][\[$Red\]\#\[$Green\]]\[\033(0\161\033(B\][\[$Red\]\$\[$Green\]]\[\033(0\161\161\033(B\][\[$NC\]"
    PS2="> "
    }
    prompt

I showed you mine, you show me yours :D

I'm sure this puts you in the category of uber geek. :)
 
Kasyx, I tried your bashrc out and got a few weird errors, specifically with the colours you defined. Could you post a screenshot?

EDIT:
Never mind, was on local and could not load the link in your first post...
 
Nothing special here, just the svn_editor stuff:

Code:
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# SET an appropriate editor for svn messages
[ -n $SVN_EDITOR ] && export SVN_EDITOR=$(which vim)
[ -n $EDITOR ] && export EDITOR=$(which vim)

BLACK="0;30m"
BLUE="0;34m"
GREEN="0;32m"
CYAN="0;36m"
RED="0;31m"
PURPLE="0;35m"
BROWN="0;33m"
LIGHT_GRAY="0;37m"
DARK_GRAY="1;30m"
LIGHT_BLUE="1;34m"
LIGHT_GREEN="1;32m"
LIGHT_CYAN="1;36m"
LIGHT_RED="1;31m"
LIGHT_PURPLE="1;35m"
YELLOW="1;33m"
WHITE="1;37m"
RESET="00m"

export PS1='\[\033[$BROWN\]\u@\h\[\033[$WHITE\] \W \$ \[\033[$RESET\]'
#export PATH="$PATH:/root/bin"

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
 
I like the KISS philosophy .. hence my pretty much default prompt. just changed the colours ..
 
Does anyone know how can I make my Bash prompt to be "yes master?" instead of the usual old boring stuff. Thanks.
 
Open your bashrc file in your favourite text editor - it's located in your home directory under the name of .bashrc (~/.bashrc). If it doesn't exist, create it.

Make sure the PS1 variable is not currently defined (i.e. by a line with PS1="blablabla")

Insert this:

Code:
PS1="yes master? "
 
Open your bashrc file in your favourite text editor - it's located in your home directory under the name of .bashrc (~/.bashrc). If it doesn't exist, create it.

Make sure the PS1 variable is not currently defined (i.e. by a line with PS1="blablabla")

Insert this:

Code:
PS1="yes master? "

Thanks, will give it a try when I get back to my Linux box! :)

EDIT: It works like a treat thanks man!
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X