Editing path permanently...but I don't have .bashrc or .profile
I want to set my path permanently for different profiles (so I can use certain commands in certain logins), so I figured it would be as simple as editing .bashrc or .profile. (.bash_profile doesn't exist) Unfortunately, neither of these files contains anything about the path. I don't want to have to set my path every time I login (export path=$PATH...)...I've been looking through the forums and haven't found much. What am I doing wrong?
shock_ez Oh I am using SuSE 8.2, if that helps. |
make that file then
|
they are basic txt file just create them with your favorite txt editor
|
Here's a copy of my .bash_profile, it's the default RH 9 profile. Except for the export HISTSIZE and HISTFILESIZE, that was added by me to keep the size of my .bash_history file down.
Quote:
|
Re: Editing path permanently...but I don't have .bashrc or .profile
shock_ez:
First thing you need to ask yourself is, "Do I want the path to be affected for all users or just for this one user?" If the answer is all users, then you can do one of two things: 1. Edit the /etc/profile file, which will contain the system path set command (just search for PATH=). Edit this line to add the new path, then save and exit. To cause the changes to take effect, simply run it, as: Code:
. /etc/profile If you don't feel comfortable editing the /etc/profile file, then 2. Edit the file /etc/rc.d/rc.local, and add a new path adjust to the end of the file. If the file doesn't exist, simply create it with a text editor, and put your new path export statement in: Code:
export PATH="$PATH:/my/new/path" If you don't want it to affect every user, simply do like the others have suggested and simply create the file ~/.profile and edd the path statement to it. That do what you want! Hope this helps! |
Great!
I put PATH=$PATH:/bunches/of/dirs in (copied from echo $PATH) into my .bashrc, and it worked great (thus far).
Just a quick question though...is there really a difference between .bashrc and.profile? SuSE tells me that .bashrc is an interactive shell and will affect .profile (the login shell)...but um...what does that really mean? thanks again! |
Try
Code:
man bash Cheers, Tink |
All times are GMT -5. The time now is 08:54 PM. |