LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Sourcing .bashrc (https://www.linuxquestions.org/questions/linux-newbie-8/sourcing-bashrc-366973/)

shifty_eyes 09-25-2005 05:05 PM

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

Tinkster 09-25-2005 05:55 PM

Close the parent shell and open a new one :}

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


Cheers,
Tink

foo_bar_foo 09-25-2005 10:42 PM

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

IBall 09-25-2005 10:43 PM

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


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