blfs book -suggested /etc/profile

Jochen Schröder jschrod at uni-muenster.de
Fri Jul 18 09:43:41 PDT 2003


Ken Moffat wrote:
> 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)
>>
> 
> Sorry,
> 
>  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
> 
Did you mean bashrc sources bash_profile because it doesn't make much 
sense the other way around?

> PS1="\u@\h \w \$"
> export PS1
> 
> with not an /etc/profile in sight.
> 
> When I echo $PS1 I get
> \u@\h \w $
> 
> so somehow it has lost the '\' from '\$'.
> 
you should be using single quotes instead of double quotes.

Jochen


-- 
In 1968 it took the computing power of 2 C-64's to fly a rocket to the moon.
Now, in 1998 it takes the Power of a Pentium 200 to run Microsoft 
Windows 95.
Something must have gone wrong.

-- 
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 mailing list