--- Shalrath <[EMAIL PROTECTED]> wrote:
> Greetings.   I recently began toying around with my bash prompt and
> color, 
> going from the information found here:
> 
> http://www2.linuxjournal.com/lj-issues/issue64/3215.html
> 
> I would like to edit /etc/bashrc in such a way that root's bash
> prompt showed 
> up as bright red, while my user accounts would be a light cyan.  
> 
> Nevermind,  mission accomplished.  
> 
> under /etc/profile, I changed
> 
> #PS1="[\u@\h \W]\\$ "
> PS1="\[\033[1;36m\][\u@\h \w]\\$\[\033[0;37m\] "
> 
> and under /root/.bashrc,  I added
> 
> PS1="\[\033[1;31m\][\u@\h \w]\\$\[\033[0;37m\] "
> 
> 
> This seems to work so far.  
> 
> Can anyone think of a more elegant way to do this?


case $USER in
         root*)
                PS1="It's \[\033[1m\]\t\[\033[0m\] on \d.\nYou are
\[\033[0;31m\]\u\[\033[0m\] at { \[\033[0;31m\]\w\[\033[0m\]
}\n\[\033[0;31m\]\\$> \[\033[0m\]"
                 ;;
         *)
                PS1="It's \[\033[0;31m\]\@\[\033[0m\] on \d.\nYou are at {
\[\033[1m\]\w\[\033[0m\] }\n\[\033[1m\]\\$> \[\033[0m\]"
                 ;;
esac

Maybe not more elegant but it works for me:

It's 07:22:50 on Sun Mar  4.
You are root at { ~ }
#> time\date is BOLD ; root is RED and ~(pwd) is RED; #> Prompt is RED

non-su has no user name, different, plain $> prompt, BOLD time... .

Don't like the 'You are root' except when am really tired... only
reason I keep it. Saved butt a couple of times.
Basically adapted/given from/by Tom at MUO. Thanks Tom!

rj









> Could this be considered to be added to Mandrake?
> 
> Jason Marsh
> 


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

Reply via email to