RFC: root/non-root bash prompts different colours?

Stuart Jansen sjansen at gurulabs.com
Wed Dec 8 20:24:32 UTC 2004


On Wed, 2004-12-08 at 12:53 -0500, Nick Bargnesi wrote:
> Yet another option would just be to alter PS1 to display something like:
> 
> -- WARNING - LOGGED IN AS ROOT --
> [root at machine root]#  

I like modifying PS1 to include this warning. It's simple and effective.
At least one person has expressed disgust at the idea of a multi-line
PS1, but it isn't hard to remove after installation. Of course, I may
not be one to speak as my PS1 is five lines tall.

Just want to re-inforce a point already made by Nick: 



> export PS1="\n-- WARNING - Use your head.  You're root. --\n[\u@\h
\W]$ "

I've found that with multi-line prompts, including a blank line at the
start makes them much easier to read. Although that does push root's PS1
from a moderate 2 lines to a slightly extreme three...

-- 
Stuart Jansen <sjansen at gurulabs.com>
Guru Labs, L.C.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20041208/0b0f31a2/attachment.sig>


More information about the fedora-devel-list mailing list