LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   I have a strange problem with $PATH.. (https://www.linuxquestions.org/questions/linux-software-2/i-have-a-strange-problem-with-%24path-164055/)

PAOLO_GRS 03-30-2004 01:53 AM

I have a strange problem with $PATH..
 
Ciao to Everybody..
I'm not so frendly using Linux, I want to know many HowTO, so..
Please, Help ME!

I'm using SuSE 9.0, and because I need to change it, I had many
problems modifing the PATH variable..

..better, I have modified PATH, entering in the ~/.bashrc file my new 2 lines

PATH=$PATH:/new_path/to/add
export PATH

The first time I open shells everithing's OK, but if I reboot the machine,
the PATH value change.. My new PATH entry is set 3 times..
So strange, no?

I don't know why, I have tried also with ~/.bash_profile but in this case PATH doesn't change..

What I can do?
Help me, please.. CIAO ;o)

jschiwal 03-30-2004 02:00 AM

You need to make the change to .bash_profile and not .bashrc .
.bash_profile is run once when you log on. .bashrc is sourced everytime you open a new terminal in x-windows. This is why the path variable keeps groing on you.

Check 'info bash' for details on which files run. Also from your home directory, type:
cat .bash_profile.
There will probably be a comment indicatiing where toinsert your path command.

PAOLO_GRS 03-30-2004 04:07 AM

Thank You for the advice..

I've tried to insert the PATH definition in ~/.bash_profile instead of .bashrc
but the system seems to ignore my instructions..

I have created ~/.bash_profile file because it didn't exists before..

It seems that this file is not sourced by my SuSE.. Incredible!

Ciao.

Gnuru 03-30-2004 04:33 AM

I've also found this quite annoying!

It depends in which order the files are read and this sometimes seems to vary from distribution to distribution. The bash man page explains in which order they are supposed to be read.

Anyway, I've got an explanation of how I fixed this problem, here (sorry can't be bothered typing it out again): http://gnuru.org/index.pl?node_id=676

PAOLO_GRS 03-30-2004 05:25 AM

Hello,
as You suggest, I have tried with this files setting but
my PATH has 3 entry repeated..

I'm still catching some strange commands in these mentioned file scripts..

Thank You for your Help..

CIAO


All times are GMT -5. The time now is 05:18 AM.