[ale] root's shell prompt

Robert L. Harris Robert.L.Harris at rdlg.net
Fri May 9 16:00:54 EDT 2003



put this in your .profile:

whoami=`whoami`
PS1="$whoami: #>"

or something similar.  Mine looks like this:

WhoAmI=`whoami`
Hostname=`hostname | cut -d\. -f1`
PS1="\[\033]1;\h\007\033]2;$WhoAmI@$Hostname : $PWD\007\]\n$WhoAmI@$Hostname\n{\$?}:\$PWD>"




Thus spake John Wells (jb at sourceillustrated.com):

> On most of my machines, when I su to root, the $PS1 prompt changes.  This
> is a nice feature, because I always know when I'm root or not by looking
> at the prompt.
> 
> However, on one of my machines, when I su to root, the prompt stays the
> same as the original uid's.  It seems to me it used to work as described
> above, but now it does not.
> 
> Anyone know what controls this behavior, and how I get it back to the way
> it was?  I really don't want the change PS1 in root's .bash_profile and
> then be forced to use "su -" all the time.
> 
> Thanks,
> John
> 
> 
> 
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale

:wq!
---------------------------------------------------------------------------
Robert L. Harris                     | PGP Key ID: E344DA3B
                                         @ x-hkp://pgp.mit.edu 
DISCLAIMER:
      These are MY OPINIONS ALONE.  I speak for no-one else.

Diagnosis: witzelsucht  	

IPv6 = robert at ipv6.rdlg.net	http://ipv6.rdlg.net
IPv4 = robert at mail.rdlg.net	http://www.rdlg.net

 PGP signature




More information about the Ale mailing list