Earlier quoted context omitted.
I think you misunderstand my point. Forget mutation; that was a minor technicality, but isn't important for my point. My point is that environment variables are "dynamic variables" (AKA they are "dynamically bound", AKA they have "dynamic scope" https://en.wikipedia.org/wiki/Scope_(computer_science)#Dynam... ). That is very much not like globals. For example, consider the following script: #!/usr/bin/env bash # The e…
If I am understanding you correctly, you are stating that a given shell, specifically a subshell -- may not in some cases see the same shell variables as other shells... That is true. Subshells may not in some cases see the same shell variables as in other shells. I'm not contesting this. But let's suppose that we have not a shell variable, but a socket... A socket that any program can open -- and retrieve a web page…
If we ignore those, and just stick to normal FS operations in an ordinary Linux process, then those filesystem objects are globals, since the filesystem is a global namespace: a name (or path, in this case) will always refer to the same filesystem object (modulo the caveats above).
---
> If I am understanding you correctly, you are stating that a given shell, specifically a subshell -- may not in some cases see the same shell variables as other shells...
No, that's not what I'm saying. I'm talking about env vars: bound via `execve`, stored near the spawned process's stack). Not shell variables, or any other language-specific/internal variables (whether a shell, like Bash, or otherwise). That's the entire reason why my code example used `export`.