Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

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.

share|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

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

See the sh (1) man page.

Which particular variables are you asking about?

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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