From owner-freebsd-hackers Mon Aug 31 12:41:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA15558 for freebsd-hackers-outgoing; Mon, 31 Aug 1998 12:41:38 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from bright.fx.genx.net (bright.fx.genx.net [206.64.4.154]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA15552 for ; Mon, 31 Aug 1998 12:41:35 -0700 (PDT) (envelope-from bright@hotjobs.com) Received: from localhost (bright@localhost) by bright.fx.genx.net (8.9.1/8.8.8) with SMTP id PAA19225; Mon, 31 Aug 1998 15:41:29 -0500 (EST) (envelope-from bright@hotjobs.com) X-Authentication-Warning: bright.fx.genx.net: bright owned process doing -bs Date: Mon, 31 Aug 1998 15:41:29 -0500 (EST) From: Alfred Perlstein X-Sender: bright@bright.fx.genx.net To: Matthew Hagerty cc: hackers@FreeBSD.ORG Subject: Re: Environment of a process In-Reply-To: <3.0.3.32.19980831150336.007233bc@wolfepub.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG man exec, look at: int exect(const char *path, char *const argv[], char *const envp[]) also note getenv(3), man 3 getenv good luck, Alfred Perlstein - Programmer, HotJobs Inc. - www.hotjobs.com -- There are operating systems, and then there's FreeBSD. -- http://www.freebsd.org/ 3.0-current On Mon, 31 Aug 1998, Matthew Hagerty wrote: > Greetings, > > Where does a process get its environment if it is not executed from the > command line? I have a program that connects to a database and relies on > several ENV VARS to be set. > > I solved the problem with a shell script that wraps the program like this: > > #!/bin/sh > > set var;export > set var;export > set var;export > > call program > exit > > There has to be a more efficient way to do this?! This particular program > is run as a CGI and wrapping it in a shell adds overhead that I'm trying to > cut down on. > > Any insight would be greatly appreciated. > > Thanks, > Matthew > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message