Shell startup scripts
bash startup scripts
See bash for a discussion on what bash runs under what circumstances.
Color prompt
I generally find it useful to have a file called .colors in my home directory, to help colorize prompts without being too arcane.
# .colors BLACK="\[\033[0;30m\]" BLUE="\[\033[0;34m\]" BROWN="\[\033[0;33m\]" COLORCLEAR="\[\033[0m\]" CYAN="\[\033[0;36m\]" DARKGRAY="\[\033[1;30m\]" GREEN="\[\033[0;32m\]" LIGHTBLUE="\[\033[1;34m\]" LIGHTCYAN="\[\033[1;36m\]" LIGHTGRAY="\[\033[0;37m\]" LIGHTGREEN="\[\033[1;32m\]" LIGHTPURPLE="\[\033[1;35m\]" LIGHTRED="\[\033[1;31m\]" PURPLE="\[\033[0;35m\]" RED="\[\033[0;31m\]" WHITE="\[\033[1;37m\]" YELLOW="\[\033[1;33m\]"
Then, something like this is typically in my .bash_profile (now that I know what it means, though, maybe it's on its way into .bashrc):
. ~/.colors
PS1="$BLUE[$WHITE\u$GREEN@$WHITE\h $LIGHTRED\w$BLUE]$GREEN\$ $COLORCLEAR"
case $TERM in
xterm*)
PS1="\[\033]0;\u@\h:\w\007\]$PS1"
;;
*)
;;
esac
The PS1 assignment in the case statement prepends another string to the prompt to tell the titlebar of an xterm what it is supposed to say.