Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 3
    I do export foo=bar in the one bash's session (pid xxxx), then do cat /proc/xxxx/environ | tr \\0 \\n in other bash's session and I don't see foo. Commented Jan 14, 2012 at 18:11
  • I updated the above answer with an example checking the same process within shell. Commented Jan 14, 2012 at 18:52
  • You are correct. I stand corrected. Thanks. I now have to go and read my manuals to check the environment variables of a different process with in the user process group. Commented Jan 14, 2012 at 19:35
  • 1
    One more thing: I tried checking the environment attaching the gdb to the pid, but still no reference there. The environment variables block in the memory gets reallocated whenever there is a change and is not reflecting in its own process' environ file in the proc filesystem, but however allows to be inherited by the child process. That means this could get easier to know intrinsic details when the fork happens, how does the child process gets environment variables copied as is. Commented Jan 14, 2012 at 19:48
  • I hope @Gilles would throw some of his torch light on this.. :-) Commented Jan 14, 2012 at 20:22