[racket] putenv

From: Kieron Hardy (kieron.hardy at gmail.com)
Date: Tue Oct 23 12:15:54 EDT 2012

I believe there is a Unix system call (available through the C interface, but not through a shell command) that can modify the environment of the parent of a process. I think it's used in the implementation of the commands that manipulate the shell's own environment. But IIRC, by design, a process can not alter the environment of a grand-parent process at all, as that ability would create a huge problem with security within the OS.

The same system call (and restriction) is probably available in Windows, and in doing a quick search to find out, I happily discovered the setx shell command (introduced with Vista?) , which claims can alter the System and User Environments permanently, and would seem to be a solution for the original question.

See http://technet.microsoft.com/en-us/library/cc755104(v=ws.10).aspx



Posted on the users mailing list.