prompt/startup files
I'm trying to set the default prompt using $PS1 in the systemwide startup file, /etc/profile
The prompt is correct for one terminal, but if I open another it's the default prompt bash-2.05b#. And when I check the $PS1 in a terminal with the bash-2.05b# prompt, I'm given \s-\v\, which isn't in any of the three startup files ( /etc/profile, .profile, or .bashrc) I've done searches in /etc/profile to be sure but that \s-\v\ isn't in any of the startup files. Here's the snippet from my /etc/profile: # Set a default shell prompt: PS1="\u@\h\w\~$ " export PS1 So where is this \s-\v\ set? |
Also, if I log out, the prompt goes back to \s-\v\. I thought /etc/profile was executed automatically when I logged in?
I have to manually execute /etc/profile to get the prompt to change, but it doesn't work on subshells. :cry: |
I still can't figure out where \s-\v\ set at.
In one terminal the $PS1 is \u@\h\w~$ ", and in any other the $PS1 is \s-\v\ |
I think /etc/bashrc gets executed after /etc/profile. Try adding the export PS1 commands to /etc/bashrc
|
Are you useing xterm?
If so try xterm -ls to tell xterm to source in all configuration files. |
That didn't work. Thanks for the idea though.
My $PS1 is correct without X running as root and users, but with X running the $PS1 as root is \s-\v\; however, the $PS1 running as a user with many terminals open is \u@\h\w~$, but not as root. |
xterm -ls gives me the same result as if I did . /etc/profile
additional terminals go back to \s-\v\ |
I don't understand the complexity of something so simple as changing PS1 systemwide.
|
I don't understand why it is not working when you add it to /etc/bashrc . What are the exact lines you add? You do restart the shell after making these changes right?
|
I added the same thing to /etc/profile to /etc/bashrc, and yes I restarted the shell.
|
All times are GMT -5. The time now is 01:47 AM. |