when PS1='\u:\w\$ ' and user is root, prompt is still $ under bash

Brandon Peirce brandon_peirce at hotmail.com
Wed Jun 7 12:37:01 PDT 2006


On Tue, 6 Jun 2006, Andrea Reina wrote:

>The issue is this: my LFS installation of bash shows a $ for the root
>prompt, when given the PS1 envar should, according to the bash info and
>man pages, give me #.

I am assuming that the \u and \w in PS1 are being correctly substitute as
login and working dir respectively, so the problem is specific to the \$
special char and not a general problem of special chars being interpreted
literally....

It sounds to me like bash is not recognizing when you run as root.
Try something like `set | grep UID' from your root shell and confirm that
both UID and EUID are zero. I'm not sure that's the exact mechanism used
by bash, but if they are right or wrong might give a clue where to start 
looking....

Hope that helps,
Brandon.





More information about the lfs-chat mailing list