0
There is something I am not understanding. I have used the method found here about changing user default directory using vipw /etc/passwd
However once I go into this file and change a user default dir setting their bash prompt changes to, from my machine from ex. "[root@directory ~]#" to "bash-4.1$"
Now if I try to change the global bash prompt $PS1 the user with change dir having bash-4.1$ cannot see the custom prompt.
What is this behavior?
I believe you are mistaken about what the directory named in /etc/passwd actually is. It's the user's home directory; it's not a "default directory", except by convention and extension because it's a directory that is supposedly writable by the user, and relatively private. (Remember Linux is a multi-user system by design.) If the named home directory doesn't exist, or if it does exist but the permissions don't grant the user read/write/execute permissions, all sorts of things will break. I have a strong feeling you are seeing one of those things breaking. – a CVn – 2015-10-17T22:05:30.100
@MichaelKjörling Thanks for the reply. Actually you're right, when I changed the directory, whatever I changed it to I realized that there were permission problems. So this means only because there was a permission problem, or whatever else it could be, this is why I'm seeing this weird bash-4.1? obviously I won't be lazy and test this but since I'm typing away here... – Guy St-Louis – 2015-10-17T22:15:27.860
@GuySt-Louis It is indeed a permission problem. The prompt changes because bash can not find a readable
.bash_profile
or the like (which is normally located in your home directory as dictated by/etc/passwd
from which it can read your prompt settings, so it reverts to defaults. – Jarmund – 2015-10-17T23:18:05.217