Mittwoch, 19. November 2008

bash: colorprompt

~/.bashrc
# actually check for color-support and set real fancy prompt
if (tput setaf 1) >&/dev/null
then
if [ $USER = 'root' ]
then
PS1='\[\e[0;31m\]\u@\h\[\e[m\]:\w\$ '
else
PS1='\[\e[0;32m\]\u@\h\[\e[m\]:\w\$ '
fi
fi


neu einlese
source .bashrc

Keine Kommentare: