LinuxQuestions.org
Register a domain and help support LQ
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-13-2004, 11:02 PM   #1
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Rep: Reputation: 30
.bashrc help


I am going insane. I have been trying to get my bash shell set for my lfs system. No matter what I do I can't seem to get the results I want. I am trying to add this path to my path /home/shane. below is what I have in my ~/.bashrc
Code:
if [ -f "/etc/bashrc" ] ; then
        source /etc/bashrc
fi
PATH=$PATH:/home/shane ; export PATH
It seems to have no effect. It does not add /home/shane to my path.


when I add this line to my ~/.bashrc in my gentoo install it reacts like I think it should: It adds the path /home/shane to my path.

Why is it behaving this way?

edit/added later
it seems none of my variables are working (if I place them in .bashrc)

Last edited by shanenin; 02-13-2004 at 11:14 PM.
 
Old 02-14-2004, 12:02 AM   #2
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
There are two things that I can suggest, neither of which i'm certain of....

.bashrc is not used by login shells, so you may want to source .bashrc from .bash_profile or .bash_login

Your home root...is it necessary to be in your path? Try creating a /home/shane/bin directory and add that to your path instead....just keeps things a bit more organized.
 
Old 02-14-2004, 02:22 AM   #3
hiteshmaisheri
Member
 
Registered: Nov 2003
Location: Kerala, India
Distribution: Red Hat, Knoppix, Mandrake, FreeBSD
Posts: 231

Rep: Reputation: 30
when u r working in init 3 that is at the shell prompt... then the bash doen't read the .bashrc file whereas it reads only the .bash_login and .bash_profile so do add it to these files.... to work it right is what i feel
 
Old 02-14-2004, 12:46 PM   #4
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Original Poster
Rep: Reputation: 30
Thanks for everyones help. It seems their is a chain of files that get sourced. I was missing my .bash_profile. IT seems that the .bash_profile is needed to source .bashrc. If it is missing the chain is broken. Below is a line from .bash_profile


Code:
if [ -f "$HOME/.bashrc" ] ; then
	source $HOME/.bashrc
With out the code above bash was not able to source .bashrc.
 
Old 02-14-2004, 07:17 PM   #5
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
yeah...that's what I have in my .bash_profile. Actually, that's all i have in .bash_profile. Everything else is being done in .bashrc
 
  


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
where is bashrc ? Kanaflloric Slackware 12 10-06-2007 03:47 PM
.bashrc ? Longinus Linux - Newbie 2 03-27-2004 12:50 PM
no .bashrc? mattman Slackware 6 06-10-2003 04:59 PM
bashrc nobu Slackware 6 03-21-2003 11:53 AM
.bashrc prasad Linux - General 1 04-14-2001 10:51 AM


All times are GMT -5. The time now is 10:02 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration