LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Settiing paths for bash (https://www.linuxquestions.org/questions/programming-9/settiing-paths-for-bash-208637/)

jgoggel 07-23-2004 04:13 AM

Settiing paths for bash
 
Hi there,
I have found out that there are many files named .bashrc.

If I want to add a PATH for example to avoid ./ when I want to compile C programs from a current directory, to which .bashrc exactly do I need to add PATH=$PATH: <whatever path>
Regards,
Jonathan

pycoucou 07-23-2004 06:12 AM

There is only one .bashrc called .bashrc. Another conf file for bash is .bash_profile. I know there is a slight difference between the two while one is executed for remote login and the other for local login (or something like that).

Maybe, it's what you need: to define the path in .bash_profile. To avoid to handle two similar file, I'll advise you to use a symbolic link from one to the other.

whansard 07-23-2004 07:14 AM

the one in your home directory.

jdruin 07-23-2004 08:24 AM

whansard is exactly right about your own login. To affect all users, put the same PATH=$PATH: <whatever path> code in the "/etc/profile" file.

keefaz 07-23-2004 08:41 AM

Quote:

If I want to add a PATH for example to avoid ./ when I want to compile C programs from a current directory
You can always use :

export PATH=$PWD:$PATH

Then run your program without ./


All times are GMT -5. The time now is 08:12 PM.