From: JimDiamond@jdvb.ca   
      
   On 2023-03-23 at 03:55 ADT, Henrik Carlqvist    
   wrote:   
   > On Thu, 23 Mar 2023 00:06:14 +0000, Joseph Rosevear wrote:   
      
   >> But what if some of the commands actively managed the current   
   >> environment including the PATH?   
      
   >> That is what I have done.   
      
   > The problem with the environment variables like PATH is that it can be   
   > inherited by child processes, but a child process cannot alter the   
   > environment of a parent process.   
      
   I saw some horrible hack in some other newsgroup where someone showed how   
   (sort of, it didn't work for me) to do this using a debugger to attach to   
   the parent process and update the parent's environment.   
      
   The person claimed it worked for him, and, if so, this violates one of my   
   long-held beliefs about "child can't affect parent's environment".   
   However, it is a bit of a cheat, since (presumably) if that works, then any   
   process with perms to attach a debugger to a particular process could   
   change its environment.   
      
   Proof that this actually could work is left as an exercise to the diligent   
   student. :-)   
      
    Jim   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|