Environment Variable

Hello,

 I need some help to understand system and user environment files, such as .profile and others. I can edit my .profile file in my home directory. What I only touch in this file is the $PATH variable and when I am logged in under a telnet session, the PATH that I specify is used and confirmed by the set command. When I am logged into the CDE, however, that $PATH variable is different. I looked at the .dtprofile file, but I do not see the entries that I see when I run "set". I would like to change for example the MANPATH variable.. What and where are all the environment config files? Does anyone know of a resource on the net so I can read about these files?

-Thanks

-AJ

the default environment settings can be found at /etc/profile

I know of this file and what it does, but I do not think it answers the question that I posted, fully. There is a lot more info offered by the "set" command other than the default generated profile file. Can you provide more info or sources to research?

I believe that CDE will not source your .profile when you open a dtterm / xterm / etc...

Look in the .dtprofile for a variable that can be set to tell it to source your .profile as well (at least on modern HP-UX variants - CDE / VUE). Between the /etc/profile, .profile, the contents of $ENV (if it's set), and the .dtprofile, you should find most of the variables, although a good-sized chunk of them may be set by your shell, or have default values set by the shell ($USER, $LOGNAME, $PWD, etc...).

To jacobsa

I hope that these answer your request:

http://www.ncl.ac.uk/ucs/unix/environment_.html
http://www.princeton.edu/~unix/Solaris/CDE.html
http://www.bme.unc.edu/studnt\_faculty/comp_guide/chapter5.html

regards,

Da Bionic one

Thanks to you all. Great information. One last question, when I do su, where is the superusers profile read from?

-AJ

To jacobsa

by default, if you do [su + login] the shell will drop you in the current directory, the same profile as you were before.
In order to keep the correct profile, you need to add a 'tilda' after the [su]

e.g
try this:
1- login as: john
2- do a pwd
3- do a printenv

4- now do a su (say) jack
5- do a pwd
6- do a printenv
... you should find that:
pwd and printenv values are the same

now try:
4- su ~jack
5- pwd
6- printenv

Et voilia....

I hope that it helps

May da force be with you...

Da Bionic one

hi,

is it '~' or '-' As far as my knowledge goes it should be 

su - username

this will run the username's profile once u log in as username. else the su does not run any profile and hence ur current profile remains as r environment

rgds
penguin

Dear all,

I do apologize for the errorneous comment. As linuxpenguin correctly pointed out, the argument for [su] is indeed [-].
N.B The tilda [~] (if I remember correctly) is used within a shell, in order for a user to return to his/her HOME directory or to any user's HOME directory.

Words from da Bionic one