On Tue, Jun 22, 2021 at 06:54:18PM -0700, Martin Jambon wrote: > This is confirmed by this definition from posix: > > A subshell environment shall be created as a duplicate of the shell > environment, except [...]
> In the posix definition, a subshell > - is not necessarily implemented as a separate process > - belongs to a unique shell > - is not a shell I have no idea how you came to the conclusion that it's "not a shell". It's a DUPLICATE OF A SHELL, and therefore a shell. The point is that it's a DIFFERENT shell. Not the original one. I mentioned earlier that there's a formal definition you can largely ignore, and just go with "a subshell is the direct result of a fork()".[1] That's all you really need to know. The formal language exists to allow for implementations in some theoretical non-Unix-like environment where fork() is not a thing. It's simply describing what a fork() does, without using that term. [1] Except for that bit about resetting signal handlers.