LinuxQuestions.org
Visit Jeremy's Blog.
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 09-25-2005, 05:05 PM   #1
shifty_eyes
LQ Newbie
 
Registered: Sep 2005
Location: Victoria, B.C
Distribution: Slackware
Posts: 11

Rep: Reputation: 0
Sourcing .bashrc


Hi,
In my ~/.bashrc I have a line to modify my PATH shell variable as follows
Code:
PATH=/home/shifty/bin:$PATH:.
Now any time I change a different part of the script and source it to update the changes my PATH (which has already been updated when i launched the terminal) gets updated again, so i have /home/shifty/bin:/home/shifty/bin:$PATH:.:.

Is there any elegant way around this or do I have to specify an absolute PATH?

Thanks
 
Old 09-25-2005, 05:55 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Close the parent shell and open a new one :}

Honestly, why would you keep sourcing ~/.bashrc from the
same shell?


Cheers,
Tink
 
Old 09-25-2005, 10:42 PM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
there is just no way around that one short of making that PATH change global
or more to the point testing your .bashrc script changes from a file other than .bashrc

in reality even though it feels funky it's just not a problem
 
Old 09-25-2005, 10:43 PM   #4
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 61
If you use ~/.bash_profile for setting environment variables, it is only done when you log in. I have found that this only seems to work if you have a text login though...

--Ian
 
  


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 login sourcing .alias ned737 Suse/Novell 2 11-17-2005 03:03 AM
sourcing a python config file? shanenin Programming 8 08-10-2005 03:19 PM
.bashrc error upon sourcing psiakr3w Linux - General 2 08-07-2004 01:44 AM
Error when sourcing file to finish program installation serendipitysdc Linux - Software 1 07-18-2004 11:16 PM
.bashrc help shanenin Linux - Software 4 02-14-2004 07:17 PM


All times are GMT -5. The time now is 09:36 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration