Can I read someone else's environment?
der Mouse
mouse at mcgill-vision.UUCP
Thu Jun 26 15:55:12 AEST 1986
>> [wants to read another process' environment]
> If you have a nice system administrator, you could hack up the ps command
> to look at the environment [...].
>
> Just look at the code for the -f option and the rest should be quite
> trivial.
Or, depending on your system, use `ps e'. I assume the second
poster above was on a USG system, our (4.2bsd) ps has no f option and
*does* have the e option, which is defined to print the environment of
the command.
There is a problem with this approach; if the environment is really
big (more than about 1K for our system), ps cannot read it all. I spent
some time grubbing about in the sources for ps and the kernel and this
would NOT be easy to fix (or if it would, someone please tell me how -
4.2bsd VAX).
--
der Mouse
USA: {ihnp4,decvax,akgua,utzoo,etc}!utcsri!mcgill-vision!mouse
philabs!micomvax!musocs!mcgill-vision!mouse
Europe: mcvax!decvax!utcsri!mcgill-vision!mouse
mcvax!seismo!cmcl2!philabs!micomvax!musocs!mcgill-vision!mouse
ARPAnet: utcsri!mcgill-vision!mouse at uw-beaver.arpa
"Come with me a few minutes, mortal, and we shall talk."
More information about the Comp.unix
mailing list