Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vi .profile

Status
Not open for further replies.

sanmi

MIS
Oct 20, 2006
35
US
Hi, I'm using bourne shell, whenever i try to vi .profile to add new path, the file is empty ( Like I just opened up a new file). Eventhough when I do env I see what's in my profile.

I don't want to dp PATH=$PATH, since this isi only a temporay fix. Does anyone know why I can't vi .profile.

Thanks in Advance.
Sanmi
 
At the risk of stating the obvious - are you in the right directory? i.e your home dir.

Steve
 
Are you sure you have actually got a .profile and you are not simply picking up the default profile?

Have you tried creating the new .profile and added the changes to your path. Do you see the changes in env?

Steve
 
You may well not have a .profile, you don't have to have one.
The env command just lists your environmental variables. You get some by default, with or without a .profile

Try the commands:
cd # change directory to your login directory
ls -al # list all files, even the hidden ones

If .profile is not there, then you haven't got one. There should be a default one in /etc/skel which you can copy to your home directory.


I hope that helps.

Mike
 
maybe /etc/profile also

some of our servers have it located there.
 
dosent changing /etc/profile edit the profile of all the users?
 
I think the .profile takes precedence over /etc/profile, so if a user has a .profile in their home directory, it will be used first.
 
Not sure if that's the case (ie .profile used first), but any settings in .profile will overwrite (or possibly add to in the case of PATH) any previously set in /etc/profile. Please feel free to correct me if I'm wrong.

I want to be good, is that not enough?
 
KenCunningham,

your explaination sounds right to me. I guess my explaination was wrong. You are right about the .profile, the paths/etc will get appended and/or modified from what is set in the /etc/profile. The /etc/profile, since it is basically part of the global system profile would have to be used first, but once the users .profile is sourced upon initiation of a remote shell or login, then that is when his .profile takes over. I'm assuming. OK, i'll shut up now before I confuse myself some more. It is too early to think, is it time to go home yet? [morning]
 
No problem - hopefully it was time to go home a while ago. Have a good weekend!

I want to be good, is that not enough?
 
The /etc/profile is read first for all users, then the individual .profile for the user logged in. This is for bourne and korn shells.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top