LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   prompt/startup files (https://www.linuxquestions.org/questions/linux-newbie-8/prompt-startup-files-62996/)

snocked 06-01-2003 08:45 AM

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?

snocked 06-01-2003 08:50 AM

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:


snocked 06-02-2003 08:10 AM

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\

Crashed_Again 06-02-2003 08:20 AM

I think /etc/bashrc gets executed after /etc/profile. Try adding the export PS1 commands to /etc/bashrc

0x0001 06-02-2003 08:30 AM

Are you useing xterm?
If so try xterm -ls to tell xterm to source in all configuration files.

snocked 06-02-2003 08:31 AM

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.

snocked 06-02-2003 11:28 AM

xterm -ls gives me the same result as if I did . /etc/profile
additional terminals go back to \s-\v\

snocked 06-02-2003 11:34 AM

I don't understand the complexity of something so simple as changing PS1 systemwide.

Crashed_Again 06-02-2003 12:04 PM

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?

snocked 06-02-2003 11:32 PM

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.