4 ms·
I don't get this. From the same perspective you can argue global variables have scope too since they are "scoped to the current process". It's not like other pr
by gnulinux 6y ago
I don't get this. From the same perspective you can argue global variables have scope too since they are "scoped to the current process". It's not like other processes can access your global variable, that's a very low bar for a scope.
- TrueDuality 6y agoThe difference here is that a running shell (including the shell environments that services run with in) are an abstraction layer about managing processes. Within that abstraction layer, each process can have its own unique environment variables that they can change and manipulate independently. That makes them not global. Within a process the top level abstraction is the process itself, and anything underneath (class, method, function) will be impacted if another sub-abstraction makes a change to a global variable.
- gnulinux 6y agoMakes sense, thanks.
- amelius 6y ago> It's not like other processes can access your global variable, that's a very low bar for a scope. They can read them, in /proc/[PID]/environ