LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-01-2003, 09:45 AM   #1
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Rep: Reputation: 30
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?

Last edited by snocked; 06-02-2003 at 09:11 AM.
 
Old 06-01-2003, 09:50 AM   #2
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30
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.




Last edited by snocked; 06-01-2003 at 09:59 AM.
 
Old 06-02-2003, 09:10 AM   #3
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30
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\
 
Old 06-02-2003, 09:20 AM   #4
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
I think /etc/bashrc gets executed after /etc/profile. Try adding the export PS1 commands to /etc/bashrc
 
Old 06-02-2003, 09:30 AM   #5
0x0001
Member
 
Registered: Sep 2002
Distribution: Slackware 8.1
Posts: 84

Rep: Reputation: 15
Are you useing xterm?
If so try xterm -ls to tell xterm to source in all configuration files.
 
Old 06-02-2003, 09:31 AM   #6
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30
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.
 
Old 06-02-2003, 12:28 PM   #7
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

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

Last edited by snocked; 06-02-2003 at 12:30 PM.
 
Old 06-02-2003, 12:34 PM   #8
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30
I don't understand the complexity of something so simple as changing PS1 systemwide.

Last edited by snocked; 06-02-2003 at 12:36 PM.
 
Old 06-02-2003, 01:04 PM   #9
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
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?
 
Old 06-03-2003, 12:32 AM   #10
snocked
Member
 
Registered: Dec 2002
Location: St. Louis, MO
Distribution: Slackware 9.1
Posts: 482

Original Poster
Rep: Reputation: 30
I added the same thing to /etc/profile to /etc/bashrc, and yes I restarted the shell.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Shell Prompt at startup hotpursuit Linux - Software 2 06-09-2004 06:18 AM
Startup Files djinniyah Linux - Software 1 09-18-2003 05:01 AM
how can i get into command prompt at startup ? suede666 Linux - Newbie 2 05-25-2003 10:33 PM
how do you turn prompt off when deleting files on redhat 8 changwoo Linux - Newbie 5 05-08-2003 09:12 PM
Backing up files from Shell Prompt xneowolf Linux - General 1 01-25-2003 02:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration