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?
Asked
Active
Viewed 2,069 times
3 Answers
1
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.
![](../../users/profiles/24243.webp)
labradort
- 1,169
- 1
- 8
- 20
-
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 08 '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. http://mtxia.com/css/Training/Shell Programming/sh2a.html – labradort Apr 09 '10 at 12:22
1
In addition to ~/.profile
, they are defined (first) in /etc/profile
.
See the sh (1) man page.
Which particular variables are you asking about?
![](../../users/profiles/23597.webp)
alanc
- 1,500
- 9
- 12
![](../../users/profiles/1293.webp)
Dennis Williamson
- 60,515
- 14
- 113
- 148
0
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.
![](../../users/profiles/34552.webp)
bacteriophage
- 56
- 2