[nSLUG] "Switchable" bash prompt (change color for root)

InverseCow rowan.townshend at gmail.com
Tue Mar 9 10:22:48 AST 2010

Hi everyone,

  I would like to add some functionality to my .bashrc at work, to
differentiate between when I am working as "myself" (uid=94307) and when I
switch up to "root" (uid=0).
  Specifically I would like to change the color on my prompt to reflect the
  What would be an elegant way to handle this?

  My default shell is KSH (environmental standard), and I switch over to
BASH before I get a prompt (minor KSH .file hack).
  I've attached a hacked down .bashrc that I use for reference (
http://old.nabble.com/file/p27836312/bashrc_rowan.txt bashrc_rowan.txt ).

"Just because I have a burnt face, doesn't mean I can't fight crime!" -- 
http://www.burntfaceman.com/ http://www.burntfaceman.com/ 
View this message in context: http://old.nabble.com/%22Switchable%22-bash-prompt-%28change-color-for-root%29-tp27836312p27836312.html
Sent from the nSLUG mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/mailman/private/nslug/attachments/20100309/8ea6e0dd/attachment-0002.html>

More information about the nSLUG mailing list