Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: net.unix Subject: Re: Can I read someone else's environment? Message-ID: <445@mcgill-vision.UUCP> Date: Thu, 26-Jun-86 01:55:12 EDT Article-I.D.: mcgill-v.445 Posted: Thu Jun 26 01:55:12 1986 Date-Received: Fri, 27-Jun-86 05:33:52 EDT References: <1983@dalcs.UUCP> <512@hropus.UUCP> Organization: McGill University, Montreal Lines: 27 Summary: depends on system type (bsd/usg) >> [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@uw-beaver.arpa "Come with me a few minutes, mortal, and we shall talk."