On Wed, Jul 14, 2004, Shachar Shemesh wrote about "Re: Manipulating an environment variable of a running proccess...": > >Hi, I'm trying to manipulate a running procces's environment variable > >while it's running. > Hook it like a debugger, and change it's runtime environment. It's your > only more-or-less sane option.
But note that whether this will work will depend on the actual program. If a program calls getenv() only when it needs a value, you'll be fine (but you can have the danger of a race condition, if you accidentally change the environment while it is being read). But if the program in question copies the environment to a different place in memory after reading it (e.g., I suppose shells do that), and use that copy instead of the original one, you'll have to know exactly what the program does to know where and how to change its concept of the environment variables. -- Nadav Har'El | Thursday, Jul 15 2004, 26 Tammuz 5764 [EMAIL PROTECTED] |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |Strike not only while the iron is hot, http://nadav.harel.org.il |make the iron hot by striking it. ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]