Operating System - HP-UX
1833832 Members
2150 Online
110063 Solutions
New Discussion

Re: adding to /etc/profile

 
SOLVED
Go to solution
Virginia OToole
Occasional Contributor

adding to /etc/profile

Is the /etc/profile the file that you should
customize to your installation or is there another version of this file somewhere that can be changed?

I would like to add some commands that all users will have access to, both new and existing. Will the file that I modify make the changes I make avaiable to existing users the next time they log on?
7 REPLIES 7
Corthouts Carlo
Valued Contributor
Solution

Re: adding to /etc/profile

Hi,

The /etc/profile sets it for all users.
You can also edit the .profile in the
users home directory.

I would suggest to put it in the users home directory so you can customize it per user.
Helen French
Honored Contributor

Re: adding to /etc/profile

Hi,

You asked the same question for the second time:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x335f50011d20d6118ff40090279cd0f9,00.html

HTH,
Shiju

Life is a promise, fulfill it!
G. Vrijhoeven
Honored Contributor

Re: adding to /etc/profile

Hi,

Jip! thats is the one.
Check out man profile.

Gideon
Craig Rants
Honored Contributor

Re: adding to /etc/profile

Virginia,
This is not the only way to accomplish your goal. One way is to use the /etc/skel dir. Create your modified .profile in there, and when you create a new user account tell the system to use the /etc/skel dir for creating files in their homedir. i.e.

useradd -u 999 -g 20 -d /home/username -c "Comments" -m -k /etc/skel loginname.

GL,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Sanjay_6
Honored Contributor

Re: adding to /etc/profile

Hi Virginia,

What you mean by, want to add some commands. If these are executables you are talking about, you shoule put them in /usr/bin. If these are environment varaibles you want to be set for all the users you should add them to /etc/profile.

You have already asked this question once,

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x335f50011d20d6118ff40090279cd0f9,00.html

Hope this helps.

Regds
A. Clay Stephenson
Acclaimed Contributor

Re: adding to /etc/profile

Hi:

When a user logs on, /etc/profile is run before the user .profile is run. Therefore, anything you do in /etc/profile could be overridden in the users .profile. The answer to your question is that it depends:
Suppose that in /etc/profile you do something like:

PATH=/bin:/usr/bin:/usr/local/bin:/usr/specialbin
export PATH


Now for User A, the .profile does this:
export PATH=${PATH}:.
and for User B the .profile does this:
export PATH=.:/usr/bin/:/usr/local/bin

A would be able to easily execute the files in /usr/specialbin but B would have to explicitly give the pathname to those same files.

It'sd generally a good idea to copy /etc/profile to something like /etc/profile.orig before making changes. That way you can't get yourself out of trouble as quickly as you got yourself in.

Regards, Clay
If it ain't broke, I can fix that.
Doni Darmawan
Advisor

Re: adding to /etc/profile

Hi all,

Why do you not try to edit or create /etc/PATH file?

Regards,