Message-Id: <3.0.6.32.19990731142240.00867b10@dce03.ipt.br> X-Sender: csrabak AT dce03 DOT ipt DOT br X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32) Date: Sat, 31 Jul 1999 14:22:40 -0300 To: djgpp AT delorie DOT com From: "Cesar S. Rabak" Subject: Re: Setting DOS environment varible with C program and export it ? In-Reply-To: <3799E8EA.83585DA8@multimania.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id NAA30449 Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk At 16:25 24/07/99 GMT, you wrote: >Hi, > >I'm writing CGI script in perl, and for debugging from command >line, under win95, I need to set some environment variable with >an equal sign inside its value. DOS seem to be unable to do such simple >thing. So I try to do it in C. > >I use the standard function setenv() getenv(), but I can export what >is done during the program to the upper shell. Is there a way for doing >such thing ? > >Currently, I've written a wrapper which set var and run the script >passed as argument or from a file... > >What I want is to recreate a setenv command. So I just have to do : > >setenv QUERY_STRING "pattern=HTML" > >and the environment variable is updated (or created) to this new value. > >Any idea ? The only one I can see is to do it in a wrapper program and then call via the spawn function family your perl intrepeter. The environment should inherit the environment variable you set. You should for sanity sake try first set the variable and spawn() or exec() printenv to be sure this works. HTH Cesar >May be creating the var with batch file, and keeping modifications done >by the program... > >Sylvain. >-- >Sylvain VIART - Computer scientist - Programmer analyst > -+= -------------------- * --------------------- =+- > Editor : VIM - 5.3 Win32 > VIM - 5.4o Linux > OS : Win95 > Linux kernel 2.0.29 (Debian 1.3.1) > -+= -------------------- * --------------------- =+- >Je suis présentement à Montréal >MAILTO:viarts AT jsp DOT umontreal DOT ca > >