blfs book -suggested /etc/profile
ken at kenmoffat.uklinux.net
Fri Jul 18 07:55:41 PDT 2003
On Fri, 18 Jul 2003, Jochen Schroeder wrote:
> Ken Moffat wrote:
> > On Tue, 15 Jul 2003, Sam Barnett-Cormack wrote:
> >>On Tue, 15 Jul 2003, Jan Van Belle wrote:
> >>>Sam Barnett-Cormack wrote:
> >>>>On Tue, 15 Jul 2003, Linux wrote:
> >>>>I don't have that problem, but for me it doesn't correctly show
> >>>>superuser shells (with a # instead of a $ at the end) - anyone know how
> >>>>to fix this?
> > Any joy on the '$ or #' part of this ? I've got my PS1 prompts set to
> > include "\$" on my boxes, but last night I discovered that on my iBook
> > root's prompt (when logging in directly) shows '#', but as a normal user
> > the prompt stays at '$' even after su'ing to root.
> > Is my bash broken ?
> No, this is because you set $PS1 in /etc/profile, but /etc/profile is
> only read when opening a new login shell, su does not open a login
> shell, but just a normal interactive one, if you want bash to set your
> new prompt, either use su - which starts a login shell, or set $PS1 in
> ~/.bashrc (you could also source /etc/profile in .bashrc)
I wasn't clear enough. On a quick look, I thought somebody had the
exact same problem I'm seeing.
As a user, .bash_profile sources .bashrc, which conditionally
sources a non-existent /etc/bashrc. After this, .bash_profile has
PS1="\u@\h \w \$"
with not an /etc/profile in sight.
When I echo $PS1 I get
\u@\h \w $
so somehow it has lost the '\' from '\$'.
You'll always find me out to lunch
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-support' in the subject header of the message
More information about the blfs-support