On Unix, is there any way that one process can change another's environment variables (assuming they're all being run by the same user)? A general solution would be best, but if not, what about the specific case where one is a child of the other?
Edit: How about via gdb?
No. This is not possible. One process can never directly manipulate the environment of a different already-running process.
Via gdb:
(gdb) attach process_id (gdb) call putenv ("env_var_name=env_var_value") (gdb) detach
This is quite a nasty hack and should only be done in the context of a debugging scenario, of course.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With