bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'wait' in command group in pipeline fails to recognize child process


From: Greg Wooledge
Subject: Re: 'wait' in command group in pipeline fails to recognize child process
Date: Tue, 22 Jun 2021 22:58:44 -0400

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]