Aleksandar Kuktin wrote:
>> On Fri, 11 Jun 2010 13:16:24 -0500
>> Mike McCarty <mike.mcca...@sbcglobal.net> wrote:
>>
>> Use a red colored prompt when running with root authorization.
>>
>> Hope you keep learning for a long time.
>>
>> Mike
> 
> See, this is a good point. :)
> 
> I should fix this on my system.

You might try this:

Put this in /etc/profile and ~/.bashrc

if [ -f /etc/bashrc ]; then
         . /etc/bashrc
fi

And this in /etc/bashrc

NORMAL="\[\e[0m\]"
RED="\[\e[1;31m\]"
GREEN="\[\e[1;32m\]"
if [[ $EUID == 0 ]] ; then
   PS1="$red\u$nor...@$hostname$red [ $NORMAL\w$RED ]# $NORMAL"
else
   PS1="\u$gr...@$hostname$green [ $NORMAL\w$GREEN ]\$ $NORMAL"
fi

   -- Bruce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to