LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-04-2004, 07:27 AM   #1
jackpal
Member
 
Registered: Oct 2003
Location: Florida USA
Distribution: Fedora, RHEL
Posts: 57

Rep: Reputation: 15
bash prompt problem


I've installed Gentoo this weekend with the 2.6.1 kernel. All is well but I am having a problem with my bash prompt.

Normally when I've logged in I get a nice prompt with my username and current working directory. This is what I get now.

bash-2.05b$

Strangely when I SSH into my box I get the proper prompt as I like it.

palmadj@w72l-penguin palmadj $

Why is this? I have a .bash_profile and .bashrc

Jack
 
Old 02-04-2004, 07:38 AM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
check your .bash_login

the different login files get run differently depending on whether you are logging
in or starting a new shell. i never can remember which though.

find your prompt definition and copy it to one of the other login files.
 
Old 02-04-2004, 08:06 AM   #3
jackpal
Member
 
Registered: Oct 2003
Location: Florida USA
Distribution: Fedora, RHEL
Posts: 57

Original Poster
Rep: Reputation: 15
I don't seem to have a .bash_login. I wonder what SSH is sourcing when I log in that a console login does not?
 
Old 02-04-2004, 08:14 AM   #4
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
i think it's the PSX definitions in /etc/profile
PS1
PS2
like that i think
 
Old 02-04-2004, 09:00 AM   #5
Nis
Member
 
Registered: Jul 2003
Location: Virginia
Distribution: Ubuntu Hoary (5.04)
Posts: 550

Rep: Reputation: 31
In your .bashrc or .bash_profile you need to set your PS1 variable. Mine is
Code:
PS1='[\T][\u:\w]$ '
The \T is the current time so that way I can look back and see what time certain commands were run.
\u is the user
\w is the current working directory

There are a whole bunch more and you can make your bash prompt look however you wish
 
Old 02-04-2004, 09:11 AM   #6
jackpal
Member
 
Registered: Oct 2003
Location: Florida USA
Distribution: Fedora, RHEL
Posts: 57

Original Poster
Rep: Reputation: 15
Thanks guys. What a great place !!

Here is what I ended up doing. In my .bash_profile I put:

export PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'

this had the proper effect. I took this line from /etc/profile. Does this mean that my login is not using /etc/profile but SSH is? It seems that to me. Thanks for all the tips.

Jack
 
Old 02-04-2004, 11:37 AM   #7
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
i never can remember, but you could quickly put a echo "bash_profile" or appropriate at the beginning of each file so you can figure out which ones are run in what order. i think the bash man page tells the order. it may be different for ssh.
 
  


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
bash prompt subG Slackware 6 01-18-2006 04:43 PM
bash prompt problem akudewan Slackware 7 03-09-2005 07:21 AM
help with bash prompt everythingand2 Linux - Newbie 7 12-06-2003 04:28 PM
Bash Prompt mandraketux Mandriva 2 11-28-2003 10:05 PM
bash problem: no prompt xyfan Linux - General 6 11-25-2003 11:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:45 AM.

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
Open Source Consulting | Domain Registration