Fresh install, wierd bash prompt issues

ewolff

Member
May 14, 2012
5
0
51
cPanel Access Level
Root Administrator
Installed centos 5.7 cpanel ISO today on a test box for a project and I am haivng some issues with the bash prompt. When I log in as root I get this as a prompt: -bash-3.2#

Running "PS1='[\u@\h \w]\$'" gives me the prompt I want, but as soon as I log out it reverts back. There was no /root/.bashrc file so I created it but it still will not inherit the settings from /etc/bashrc.

Problem 2. Logging in as a user I get a more accurate prompt but when I use sudo to elevate the prompt does not change from $ to #. I fixed this by editing the /etc/bashrc file to look more like a standard centos bashrc with the extra cpanel fluff left in. This is now working the way I expect it to but I still get the wrong prompt when I log in as root.

90% of the time I would use my elevated user account anyway, but I find it highly irritating that when logged in as root I can't see what directory I am in without doing a pwd.