Indeed, each time you open a shell, your .bashrc
is executed. And thus, with your current code, your PATH
will grow indefinitely.
If you only need this change to path for your shell, you can just remove the export
, and let in your .bashrc
:
PATH=$PATH:$VRS/bin
If your need to have this change more global, move your line (and the code defining your $VRS
) to file ~/.profile
, but by keeping the export
. This file is only executed at login, not each time your open a shell.
Or even to /etc/profile
if you want this change to be for all users.
Nice, more options than mine. I didn't think of the user profile and global profile files :) – ADTC – 2013-08-01T07:33:54.077