Environment help please


 
Thread Tools Search this Thread
Operating Systems Solaris Environment help please
# 1  
Old 06-11-2007
Environment help please

Hello all,
I am a bit confused not only because I am new to Solaris but because when I run "env" I get a list of variables that are not in the user .profile. Where else can the account be getting environment variables from?

Is there a .profile that applies to all accounts?


Thank you in advance for your expertise.
# 2  
Old 06-11-2007
Quote:
Originally Posted by komputersman
Is there a .profile that applies to all accounts?
Yes, /etc/profile.

Others may be set by the shell when it initializes or the remote login service being used before initializing the shell (eg ssh sets some variables )
# 3  
Old 06-11-2007
Hmmm

That dosen't look like it either... Here is what I am getting when I run "env"

USER=XXXXX
LOGNAME=XXXX
HOME=/home/XXXX
PATH=/opt/xampp/bin:/usr/local/bin:/usr/ccs/bin:/usr/bin/X11:/home/XXXXX/bin:/usr/sbin:/sbin:/usr/bin:/bin:/usr/ucb:/opt/gnu/gnat/bin
SHELL=/bin/tcsh
TZ=US/Arizona
SSH_CLIENT=XXXX
SSH_TTY=XXXX
TERM=xterm
HOSTTYPE=sun4
VENDOR=sun
OSTYPE=solaris
MACHTYPE=sparc
SHLVL=1
PWD=/etc
GROUP=other
HOST=prclab
REMOTEHOST=XXXX
LD_LIBRARY_PATH=/usr/lib:/usr/ucblib:/lib:/usr/local/lib:.=
DOORSHOME=/usr/local/doors
SERVERDATA=/usr/local/doors/data
PORTNUMBER=XXXX
DOORSDATA=XXXXX@localhost
LM_LICENSE_FILE=XXXX@XXXX
MANPATH=/opt/xampp/share/man:/usr/man:/usr/local/man:/usr/openwin/man:/usr/lang/man:/usr/share/man:/usr/local/teTeX/man
INFOPATH=/usr/local/info:/usr/local/teTeX/info
TETEXDIR=/usr/local/teTeX
ADA_INCLUDE_PATH=/opt/gnu/gnat/lib/gcc-lib/sparc-sun-solaris2.5.1/2.8.1/rts-native/adainclude/=
ADA_OBJECTS_PATH=/opt/gnu/gnat/lib/gcc-lib/sparc-sun-solaris2.5.1/2.8.1/rts-native/adalib/=
LD_LIBRARY_PATH=/usr/local/lib:/lib:/opt/SUNWspro/lib:.=
VISUAL=vi
EDITOR=vi


And here is my .profile...

MAIL=/usr/mail/${LOGNAME:?}

And should I have all these files? ...

.cshrc
local.cshrc
local.login
.profile
local.profile
.profileold

And here is the /etc/profile...

#ident "@(#)profile 1.19 01/03/13 SMI" /* SVr4.0 1.3 */

# The profile that all logins get before using their own .profile.

trap "" 2 3
export LOGNAME PATH

if [ "$TERM" = "" ]
then
if /bin/i386
then
TERM=sun-color
else
TERM=sun
fi
export TERM
fi

# Login and -su shells get /etc/profile services.
# -rsh is given its environment in its .profile.

case "$0" in
-sh | -ksh | -jsh | -bash)

if [ ! -f .hushlogin ]
then
/usr/sbin/quota
# Allow the user to break the Message-Of-The-Day only.
trap "trap '' 2" 2
"profile" [Read only] 46 lines, 712 characters


Where is it getting the rest from? Particularly I am interested in the doors related files.
# 4  
Old 06-11-2007
Maybe this is a better way to ask....

How is it a user account gets its environment upon logging it, are there levels, like global settings then user settings? I am trying to figure our where the settins are being applied from so I can edit it.

Thank you,
# 5  
Old 06-11-2007
Some stuff may be set by sshd daemon. Some stuff is set by the login program. But once the shell is exec'ed it will read the file like /etc/profile and .profile. You need to stop worrying about where they get set. You want to change them? If you want to change them for all users, do it in /etc/profile. For an individual user change them in .profile. It does not matter where they get set. Are you going to write a new sshd? Or a new login? Just put the stuff you want in the appropriate config file. The environment will be what you want before the shell passes control to the user. But remember that users can override your choices by putting stuff in their individual .profile files. You cannot control that.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Environment Variables

Hi All, I need to understand following three environment variables and their usages in HP Unix. _M_ARENA_OPTS _M_CACHE_OPTS PTHREAD_SCOPE_SYSTEM How does these environment variables influence multi threaded applciation and how do we decide the value of these variables? Is there... (0 Replies)
Discussion started by: angshuman
0 Replies

2. UNIX for Dummies Questions & Answers

Environment variables

why are all environment variables represented in a fixed format regardless of the shell you use? like $HOME $PATH etc (6 Replies)
Discussion started by: sravani
6 Replies

3. Solaris

Environment Variable

Hi All, I am new to SUN Solaris.I have some questions regarding environment variable.:confused: Q1. Where the environment variables available in Solaris. Q2. What command used here. Q3. Can a user change this .Suppose i want to change the bash to ksh can it be possible here. Or i need to... (2 Replies)
Discussion started by: jdash.ps
2 Replies

4. Programming

Getting another process' environment

Suppose that I have an environment variable (call it "EVAR") that I set before running a process (call it "myproc"). "myproc" is run multiple times by multiple users and each may set "EVAR" differently. I.E.: UserA: export EVAR=v1 myproc UserB: export EVAR=v2 myproc Now "myproc" is... (3 Replies)
Discussion started by: DreamWarrior
3 Replies

5. Shell Programming and Scripting

environment variables

Hi, If i have a variable set and exported in my pofile file will that variable be available in all shell scripts created. Thanks, Radhika. (3 Replies)
Discussion started by: radhika03
3 Replies

6. UNIX for Advanced & Expert Users

Reset environment - ".. /etc/.environment dev_env"

I have been resently working on some ksh script. One of the line in the file writes: .. /etc/.environment dev_env I can not understand what this mean, all I know is .environment is unix system environment file. Is ".." a command? If some one can give me some clue where can I find information... (7 Replies)
Discussion started by: zzwu3591
7 Replies

7. Programming

environment variables

hi, I want to create a new EV(Environment Variable) through a c program and I done this thing through setenv() method. But the newly created EV is not permanent, i.e. when I exit from the program the EV also no longer lives. But I want to make it a permanent EV for the current user. Actually I... (6 Replies)
Discussion started by: sumsin
6 Replies

8. UNIX for Dummies Questions & Answers

help..Environment variables...

hi, 1). i would like to know what is meant by environment variables? 2). is the number of envi variables is a constant number for unix systems? 3). how to see the list of envi variables (and the values of the envi variables)in a single command? 4). if this questions were already asked... (3 Replies)
Discussion started by: sekar sundaram
3 Replies

9. AIX

chroot environment

Hi!! I'm currently running AIX 4.3.3 and i'm trying to setup a chroot environment for the users who use SFTP, i spend a lot time SFTW but i can't make it work. I got openssh3.9p1 whit the chroot patch. Any help is greatly appreciated. (0 Replies)
Discussion started by: samurai79
0 Replies

10. UNIX for Dummies Questions & Answers

Cron Environment

I am trying to run a series of perl scripts at different times using crontab under solaris. The scripts that i am using require some specific environment variables to be specified for database functionality, but i would also like it that i can specify a few global variables for output locations. ... (8 Replies)
Discussion started by: Smitty McSmith
8 Replies
Login or Register to Ask a Question

Featured Tech Videos