malfist Posted August 7, 2007 Report Share Posted August 7, 2007 I can't get my path variable to stick after reboot. I don't know how. I've been doing this to edit it: $PATH=PATH:new/path export $PATH and it's not sticking after reboot. Anyone know what I'm doing wrong? [moved from Software by spinynorman] Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted August 7, 2007 Report Share Posted August 7, 2007 (edited) The file to add the path globally for all users would be /etc/profile You may have a section that looks similar to this: if [ "$UID" -ge 500 ] && ! echo ${PATH} |grep -q /usr/games ; then PATH=$PATH:/usr/games fi Add another section just below it that looks like this: if [ "$UID" -ge 500 ] && ! echo ${PATH} |grep -q /new/path ; then PATH=$PATH:/new/path fi If you just want it to affect one user, in that user's ~/.bash_profile, put this: if ! echo ${PATH} |grep -q /new/path ; then PATH=$PATH:/new/path Just above: export PATH You will either have to log out and back in for the changes to take effect, or do this in a console as the user: source /etc/profile or source ~/.bash_profile After this, the path will remain until some other action may cause the system to edit one of those files. P.S. I'm assuming you realize your example is a typo: $PATH=PATH:new/path export $PATH was actually this: PATH=$PATH:new/path export PATH Edited August 7, 2007 by Steve Scrimpshire Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.