set path for different software in the bashrc file
Hello all,
I am a begginner in linux using redhat. I have installed a software and set the variables in the .bashrc file to avoid setting them everytime I would like to run te software. Now I have installed a new software and would like to do the same thing in the .bashrc file. How can I add the path to the new software directory without affecting the first software path. Regards |
kharnab,
Please paste whatever you have tried so far here. If you want to set another variable, do the same thing which you did to set the variable before. Code:
VAR="/new/path" Code:
PATH=$PATH:$HOME/bin:/sbin/ |
The usual way to achieve what you want to do is the /etc/profile.d system. Each software that needs environmental variables set installs a *.sh script in that directory. When bash starts up a login shell it runs /etc/profile and /etc/profile runs (sources) all the /etc/profile.d/*.sh scripts. This has the advantage of modularising the configuration scripts so that /etc/profile itself does not need to be changed each time a new software is installed, upgraded or removed.
If you want to set the software environmental variables for one user only, rather than globally, you could implement something like the /etc/profile.d system in the home directory, with say a ~/.bashrc.d directory. |
All times are GMT -5. The time now is 07:04 PM. |