[Tutor] accessing another system's environment

Steve Willoughby steve at alchemy.com
Fri Feb 25 04:46:17 CET 2011


On 24-Feb-11 19:30, Bill Allen wrote:
> I have times when it is useful for me to check the environment of a user
> system on our lan remotely while trouble shooting and issue with them.
> Now, this is quite easy to do while I am using a windows system via the


Are you sure you're talking about the same thing we are when you say 
"environment"?  There is no "the" environment on Unix-like systems. 
Every single process has its own environment.  Each user's login session 
loads their personal set of environment variables, which is inherited by 
the processes they launch, but can be modified from process to process.

Meanwhile, other users have their own environment, and system services 
have their own, etc.

I thought Windows was similar in this respect, isn't it?

> computer management console.   However, I am trying to do this via a
> linux workstation (which is joined to the domain, etc.).   I cannot find
> a native facility to duplicate the computer management functions, so I
> thought I would write a program to fill the need.   Not to mention, I
> thought it might be a good learning opportunity.

Getting environment variables is easy if you can get your script to be 
executed in that environment.  Finding the environment of a running 
process can be done easily, too.  Look at the output of "ps" with 
certain options set, or the contents of files in /proc.  However, 
remember that there are as many environments are there are processes.
-- 
Steve Willoughby / steve at alchemy.com
"A ship in harbor is safe, but that is not what ships are built for."
PGP Fingerprint 48A3 2621 E72C 31D9 2928 2E8F 6506 DB29 54F7 0F53


More information about the Tutor mailing list