Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Aug 1997 18:40:07 +0200
From:      Sheldon Hearn <axl@iafrica.com>
To:        Charles Mott <cmott@snake.srv.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: su and PS1 
Message-ID:  <7936.872527207@axl.iafrica.com>
In-Reply-To: Your message of "Mon, 25 Aug 1997 09:06:51 MST." <Pine.BSF.3.96.970825090408.8405A-100000@darkstar.home> 

next in thread | previous in thread | raw e-mail | index | archive | help

> If you are using bash, and PS1='\$', then the prompt will be $ for a
> normal user account and # after su to root.  This is described in the bash
> man page.  I don't know how the other shells handle this.

You're correct. All of sh, bash and csh render \$ as "#" for superuser.
But this has nothing to do with my original point.

My point is that the su manpage appears to claim that su does something
it doesn't seem to do. Perhaps what the manpage _means_ is "if you
change uid to 0 your shell will probably use a '#' as your prompt,
depending on whether you use \$ in your PS1 environment variable". But
that's not what it says.

It may just be badly worded, but the manpage is _easily_
(mis)interpreted as meaning "su changes your prompt".

If this just boils down to poor wording, I don't think the su manpage
should mention the change of prompt at all. The prompt change has 
nothing to do with su. It's solely dependant on your shell and any 
files your shell uses to configure the environment.

The exception is that su -l causes the shell to believe it's a login
shell, hopefully forcing it to use profiles of some kind to configure
the environment. Still, any effect this has on the prompt relates to 
the shell, not su.

Is this the sort of hair-splitting that we'd all rather do without, or 
do other people think the manpage would be clearer without the 
reference to the superuser prompt?

Sheldon.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7936.872527207>