Is there a way to set environment variables in Linux using C?
I tried setenv() and putenv(), but they don\'t seem to be working for me.
setenv()
putenv()
The environment block is process-local, and copied to child processes. So if you change variables, the new value only affects your process and child processes spawned after the change. Assuredly it will not change the shell you launched from.