Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!ames!oliveb!intelca!mipos3!pinkas From: pinkas@mipos3.UUCP (Israel Pinkas) Newsgroups: comp.unix.questions Subject: The environment of the parent Message-ID: <261@mipos3.UUCP> Date: Wed, 19-Nov-86 11:58:41 EST Article-I.D.: mipos3.261 Posted: Wed Nov 19 11:58:41 1986 Date-Received: Thu, 20-Nov-86 01:28:44 EST Reply-To: pinkas@mipos3.UUCP (Israel Pinkas) Distribution: net Organization: Intel, Santa Clara, CA Lines: 30 A co-worker of mine has asked me a question that I could not resolve and am now asking the net to help me with. He has a program which look in the environment (using getenv()) for certain strings. If the strings are not present, he asks the user for values. What he would like to do is set the value of these strings so that subsequent runs of the program will be able to find the values. That is, he would like to place the typed-in values in the parents environment space. (This program is being ported from VMS, which allows such things to be done.) Calls to putenv() are not the solution as programs only receive a copy of the parent's (read shell) environment and are only able to modify their own environment. This does allow you to spawn a shell, which will have any values placed in the environment, but this is not what we want. Any pointers as to how to get at, and set, the parent's environment would be helpful. Note: We are running Ultrix v1.2 on a variety of Vaxen. Info about any Un*x-like OS would be helpful. If there is enough response, I will summarize on comp.unix.questions. -Israel -- ---------------------------------------------------------------------- UUCP: {amdcad,decwrl,hplabs,oliveb,pur-ee,qantel}!intelca!mipos3!pinkas ARPA: pinkas%mipos3.intel.com@relay.cs.net CSNET: pinkas%mipos3.intel.com