Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-25-2005, 04:05 PM   #1
LQ Newbie
Registered: Sep 2005
Location: Victoria, B.C
Distribution: Slackware
Posts: 11

Rep: Reputation: 0
Sourcing .bashrc

In my ~/.bashrc I have a line to modify my PATH shell variable as follows
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?

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

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

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

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

Rep: Reputation: 53
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, 09:43 PM   #4
Senior Member
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
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...



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

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

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