[Top][All Lists]

[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: Lawrence Velázquez
Subject: Re: 'wait' in command group in pipeline fails to recognize child process
Date: Tue, 22 Jun 2021 20:00:08 -0400
User-agent: Cyrus-JMAP/3.5.0-alpha0-530-gd0c265785f-fm-20210616.002-gd0c26578

On Tue, Jun 22, 2021, at 6:32 PM, Martin Jambon wrote:
> I would also mention pipelines here, since these are more commonly
> used than () subshells.  I don't know if there are other ways of
> creating subshells.  If that's all, I think it would be valuable
> to mention those two cases rather than just one.

There are also command substitutions and any commands run asynchronously.

If the description applies to all subshells, not just ones inside
(...), then perhaps the documentation should just omit "()" instead
of spelling out every possible way a subshell can be created.

> Well, I suppose "root shell" could be misunderstood as a shell run by 
> the 'root' user but this doesn't make much sense in this context.

Yes, but then the reader is left to reverse-engineer the meaning
of this term you just made up.  If the documentation is to be
changed, it should be more clear than before.  "Root shell" makes
it less clear and should not be used.  There wouldn't be anything
wrong with adding a more verbose but more precise explanation.

> I also changed "invoking shell" to "root shell" because the invoking 
> shell or parent shell is not necessarily the same as the root shell e.g.
> $ echo $$; (echo $$; (echo $$))
> 688918
> 688918
> 688918

Maybe something like this would get the point across:

        ($$) Expands to the process ID of the shell.  In a subshell,
             it expands to the value that $$ has in the invoking shell.


reply via email to

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