delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/03/12:26:57

Date: Mon, 3 Feb 1997 19:11:19 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Chris A. Triebel" <cat AT sun4 DOT iol DOT unh DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: about setting enviroment variables (dos/4dos/bash)
In-Reply-To: <Pine.SUN.3.91.970203083701.29629A-100000@sun4.iol.unh.edu>
Message-ID: <Pine.SUN.3.91.970203190405.27257T-100000@is>
MIME-Version: 1.0

On Mon, 3 Feb 1997, Chris A. Triebel wrote:

> I was wondering, is it possible to set an enviroment variable in the 
> parent shell using a djgpp program.  I noted putenv() which states that 
> it changes the program's variables, and setenv().  I had hoped setenv() 
> would do this, but it seems like it only sets the program's env.

This is in general not possible without using undocumented DOS 
structures.  There is no library function in DJGPP that implements such 
functionality (`setenv' and `putenv' aren't supposed to do that, they 
only change the environment of the calling program and all the programs 
it spawns).

> My above line of thought was to store the push/pop stack in an enviroment 
> and manipulate it in my program.  This seemed the easiest to manage.

Call pushd/popd from a batch file.  A batch file can set an environment 
variable in its shell.

> And as for bash I 
> haven't quite got that configured properly, it seems that when I run vim 
> I get trash on my screen ( wrong term setting ), and I am not familiar 
> enough with bash, yet, to set it up properly.  If anyone has any advice 
> on this topic I would be appreciative, but I haven't done much in the way 
> of research yet, so I won't ask more than that ...

First, get the latest version of bash, such problems get constantly 
corrected there.  (An announcement was posted here about bashb6.zip just 
a day ago.)  If the problem persists, post a detailed description here: 
the author of the bash port reads this news group and will either suggest 
a solution or fix the bug.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019