3 ms·
No, in many cases one needs to set them interactively. Consider for instance something as simple a implementing a shell. Such a program needs to be able to set
by Blikkentrekker 3y ago
No, in many cases one needs to set them interactively.
Consider for instance something as simple a implementing a shell. Such a program needs to be able to set the environment based on user interaction and this change needs to show up in /proc/$pid/env.
- __david__ 3y agoWhy does a shell need its current environment to be visible in /proc/$pid/env (as opposed to just its initial environment)?
- Blikkentrekker 3y agoBecause the specification of the POSIX shell says that `export` changes the current environment of the running process, not just of any newly started processes. This is useful to recognize various processes I suppose. I have written code that scans the environment of processes to find particular processes and group them together.