Dec 29 2009

Bash Colored Root Prompt

Published by at 4:38 pm under Linux

From Linux Suse /etc/bash.bashrc:

# Colored root prompt (see bugzilla #144620)
if test "$UID" -eq 0 -a -t && type -p tput > /dev/null 2>&1 ; then
   _bred="$(tput bold 2> /dev/null; tput setaf 1 2> /dev/null)"
   _sgr0="$(tput sgr0 2> /dev/null)"
   PS1="\[$_bred\]$PS1\[$_sgr0\]"
   unset _bred _sgr0
fi

No responses yet

Comments RSS

Leave a Reply