1826631 Members
3435 Online
109695 Solutions
New Discussion

Re: Refresh .profile

 
mrk_1
Frequent Advisor

Refresh .profile

Hi,
How to refresh the .profile for one user?

I am new to Unix system admin, Guide me which book or docs I can refer to know all system admin part.

Thanks in advance,
Ram.
8 REPLIES 8
Patrick Wallek
Honored Contributor

Re: Refresh .profile

What do you mean "refresh the .profile for one user"? How do you want to refresh it?

The .profile is a plain text file so it can be edited with vi.
James R. Ferguson
Acclaimed Contributor

Re: Refresh .profile

Hi Ram:

If I understand your objective, copy '/usr/newconfig/etc/skel/.profile' as the user's profile; chown it to the user and modify what you need again.

Books and documents? The manpages and (to start):

http://docs.hp.com/en/B2355-90950/index.html

Regards!

...JRF...
mrk_1
Frequent Advisor

Re: Refresh .profile

Hi,

I exported one environment variable for one user. I thought, need to refresh the .profile to reflect the change. Sorry for the confusion. Hope It will take the variable once I export it.

Thank you Patrik and James.

Thanks.
Ram.
TTr
Honored Contributor

Re: Refresh .profile

If by refresh you mean reload the .profile after modifying it, the safest method is to logout and login again. You can also source it or "dot it" by running ". .profile" (note the first dot and sopace) but with this method only deleted variables do not get null-ed, they are still set.
Asif Sharif
Honored Contributor

Re: Refresh .profile

Hi Ram,

As per my understanding, you are asking about this command.

$. ./.profile

Dot space dot slash dot profile

OR

the best way is logout and login again. It will load with latest changes done by you.

http://docs.hp.com/en/B9106-90011/profile.4.html

Regards,
Asif Sharif
Regards,
Asif Sharif
Deepak Kr
Respected Contributor

Re: Refresh .profile

$cd
$. ./.profile
"There is always some scope for improvement"
Steven Schweda
Honored Contributor

Re: Refresh .profile

Perhaps:

. ~/.profile

There's no need to do "cd", but without doing
it, "./.profile" (which is exactly equivalent
to ".profile") may not work.

The "./" in "./file_name" is useful if you're
using it as a command (the first token on the
command line), but it's pointless in
". ./file_name".

Sometimes it's helpful to think about what
the shell does with a command, rather than
throwing in every good idea from every
context, whether or not it makes any sense
in the current situation.
Dennis Handly
Acclaimed Contributor

Re: Refresh .profile

>Steven: Perhaps: . ~/.profile

Correct.

>The "./" in "./file_name" is useful if you're using it as a command, but it's pointless in ". ./file_name".

Quite the contrary, a real shell (ksh(1) and sh-posix(1)) says PATH is used, so all root users must use ./ for sourcing too.

>rather than throwing in every good idea from every context

Sometimes the good ideas are mandatory since the same design was used. :-)