Using Bourne shell on Solaris 10, there are many environment variables defined that are not in the .profile. Where and how do these get defined?

link|improve this question
feedback

3 Answers

Try looking in /etc/profile and /etc/default/login on Solaris. Some values may be built-in defaults or picked up from the environment, such as LOGNAME or HOSTNAME.

link|improve this answer
So by built-in do you mean they are not defined anywhere in a script file but are created by the shell itself when it starts up? Are these documented anywhere? Thanx. – Brian Walsh Apr 8 '10 at 14:59
I'm not sure where to find it fully documented, but it is pretty clear there are many variables shown by a command like "set" which are not derived from the files in /etc. Most if not all of the variables can be updated with your own value (e.g. PS1). Here is one site talking about it. mtxia.com/css/Training/Shell Programming/sh2a.html – labradort Apr 9 '10 at 12:22
feedback

In addition to ~/.profile, they are defined (first) in /etc/profile.

See the sh (1) man page.

Which particular variables are you asking about?

link|improve this answer
feedback

Env vars can be set in a lot of places: startup scripts, /etc/profile for users without a .profile, via cron, via service startups...anything that is read, referenced, or executed.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.