see also : http://www.troubleshooters.com/linux/prepostpath.htm
source : http://www.hypexr.org/bash_tutorial.php#whatis
In your home directory, 3 files have a special meaning to Bash, allowing you to set up your environment automatically when you log in and when you invoke another Bash shell, and allow you to execute commands when you log out.
These files may exist in your home directory, but that depends largely on the Linux distro you're using and how your sysadmin (if not you) has set up your account. If they're missing, Bash defaults to /etc/profile.
You can easily create these files yourself using your favorite texteditor. They are:
- .bash_profile : read and the commands in it executed by Bash every time you log in to the system
- .bashrc : read and executed by Bash every time you start a subshell
- .bash_logout : read and executed by Bash every time a login shell exits
.bash_profile is read and executed only when you start a login shell (that is, when you log in to the system). If you start a subshell (a new shell) by typing bash at the command prompt, it will read commands from .bashrc. This allows you to separate commands needed at login from those needed when invoking a subshell.
However, most people want to have the same commands run regardless of whether it is a login shell or a subshell. This can be done by using the source command from within .bash_profile to execute .bashrc. You would then simply place all the commands in .bashrc.
Example .bash_profile
==================
# .bash_profile
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
Example .bashrc (Now add all your installation path in .bashrc)
============================================
# .bashrc
# _LIBRARY PATHs
PYTHONPATH=/home/tanviralam/kaustmachine/basedir/Python-2.7.6/
PATH=$PATH:$PYTHONPATH
export PATH
Comments
Post a Comment