I added a PATH to /etc/profile but "echo $PATH" says it's not there?
I added /usr/games/bin to root's PATH in the /etc/profile file, but it isn't showing up when I run "echo $PATH". I can do PATH=$PATH:/usr/games/bin but this change isn't persistent. It'll undo itself when I open a new terminal.. How do I fix this? Here is my /etc/profile configuration....
Code:
# /etc/profile: login shell setup |
remove this "${ROOTPATH}" and change it to
The $PATH should not be needed for this one ?? it might depending on other files like bash.bashrc Code:
|
Quote:
Code:
# /etc/bash/bashrc |
then add it to the one below
and log in as a normal user ( mind you my experience is with rhel and that family of OS's ) |
Copy /etc/bash/bashrc into your user and root folders as .bashrc. It serves as a template that you can edit to suit the your preferences when working as user or as root. There is no need to remove any changes you have made to /etc/bash/bashrc. The next time you have an update to bash, /etc/bash/bashrc will be overwritten. The .bashrc in you home or root folder will not be touched by an upgrade.
To make your desired PATH permanent, add this to your .bashrc: export PATH=$PATH:/usr/games/bin If you want to add another folder to the PATH, just add a colon and the next folder in the PATH. Once you are done editing .bashrc, save it then run source .bashrc to immediately see the change. |
Member Response
Hi,
I agree with bigrigdriver's suggestion and I advise users to setup '.bashrc & .bash_profile for their users. Look at this LQ post #5 which shows you how to use '.bashrc' and '.bash_profile for your user. In my example you source '~/.bashrc' via '~/.bash_profile'. Modify the sample '.bashrc' to suit your needs. HTH! |
I dug into the Gentoo docs and came to a few realizations: $PATH variables are not typically stored in /etc/profile, but rather specified in files in the /etc/env.d directory which is then parsed with env-update and catenated into /etc/profile.env. Second, my specific problem, and the reason I was trying to edit the paths in the first place, was solved when I added myself to a group. (Stupid me! This should have been the first thing that I checked..)
And finally, there is a small discrepancy in that the $ROOTPATH in a no-x environment differs from the $ROOTPATH in my X environment (the one in the no-x environment holds more directories than the one in the X environment). But this is a really, really, really small problem as root is authorized to do anything, anyway - so now I'm marking this thread as solved. Thanks for all your help, I really do appreciate it. |
All times are GMT -5. The time now is 05:33 PM. |