mikshaw
Group: Members
Posts: 4856
Joined: July 2004 |
|
Posted: Jan. 02 2006,21:49 |
|
The PATH variable, like any environment variable, is unique to each user. In order for user2 to have the same directory in PATH that user1 has, user2 will need to do the same that user1 did....namely modify his PATH variable to include another directory.
Keep in mind that "$HOME" for root is not the same as $HOME for dsl, so root will have to use the command with a full path:
Code Sample | export PATH="$PATH:/home/dsl/bin" |
Notice here that I also switched the new directory to the end of root's PATH instead of the beginning. This is just a precaution...if there was an executable in that directory with the same name as something root needs in /sbin or /usr/sbin, things could get messy.
I typically add $HOME/bin to the beginning of dsl's PATH for exactly the opposite reason. I want to be able to override system executables with my own. This lets dsl use custom versions of (most) system-wide apps without preventing other users from having the defaults.
EDIT: Also note that root's personal files cannot be restored with the backup/restore system (no write permission to /root for dsl), but you ca probably put that command in another startup file run by root, such as /opt/bootlocal.sh. I can't say for sure that it will work though, since i've never tried modifying environment from a boot script. If it doesn't work, you can put this in bootlocal:
Code Sample | echo 'export PATH="$PATH:/home/dsl/bin"' >> /root/.bashrc |
That's single quotes surrounding the echo so it will echo literally.
-------------- http://www.tldp.org/LDP/intro-linux/html/index.html
|