color in console

color in console

Postby charizan » Tue May 20, 2008 9:56 am

Add the following into .bashrc. Please make a backup of .bashrc in case that you may a mistake or something!

function setprompt
{
local RED="\[$(tput setaf 1)\]"
local RESET="\[$(tput sgr0)\]"
if [ `id -u` = 0 ] # check if user is root
then
PS1="$RED[\u@\h:\W]$RESET "
else
PS1="[\u@\h:\W]$RESET "
fi
}
setprompt
It's only funny until someone gets hurt, then it's hilarious!
User avatar
charizan
Guru
 
Posts: 1340
Joined: Wed Apr 23, 2008 8:17 pm
Location: Limassol

Return to misc...

Who is online

Users browsing this forum: No registered users and 5 guests

cron