X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: 29 Jan 2004 08:24:35 +0200 Message-Id: From: Eli Zaretskii To: djgpp AT delorie DOT com In-reply-to: <4017ddaa$1_6@Newsfeeds.com> (nathankreiger@hotmail.com) Subject: Re: How do I feed output of DOS commands into a program? References: <4017ddaa$1_6 AT Newsfeeds DOT com> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Nathan Kreiger" > Newsgroups: comp.os.msdos.djgpp > Date: Wed, 28 Jan 2004 08:06:18 -0800 > > I ran PROG1 and set the variable to "One, two, three, test.", > but when PROG2 trys to read the variable, it's already gone. > (Garbage collection at work?) This happens because the environment variables set by PROG1 are gone when PROG1 exits (they live in a block of memory that is allocated for PROG1 and deallocated when PROG1 exits). > Is there a way to set environmental variables so that they stay put > even when the program that set them terminates? The only portable way to do it is with a batch file.