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

2021-06-23 Thread Martin Jambon
On 6/23/21 6:24 AM, Chet Ramey wrote: On 6/22/21 9:54 PM, Martin Jambon wrote: In the posix definition, a subshell - is not necessarily implemented as a separate process - belongs to a unique shell - is not a shell Why is it not "a shell?" Because '$$' doesn't mat

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

2021-06-22 Thread Martin Jambon
On 6/22/21 6:11 PM, Lawrence Velázquez wrote: On Tue, Jun 22, 2021, at 8:52 PM, Martin Jambon wrote: It's better. However, the reader is still left wondering what "the shell" is referring to in first sentence. Subshells aside, I have a hard time believing that "the pro

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

2021-06-22 Thread Martin Jambon
On 6/22/21 5:00 PM, Lawrence Velázquez wrote: 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. It's better. However, the reader is still left wonder

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

2021-06-22 Thread Martin Jambon
On 6/22/21 1:37 PM, Greg Wooledge wrote: On Tue, Jun 22, 2021 at 01:12:10PM -0700, Martin Jambon wrote: On 6/22/21 4:31 AM, Greg Wooledge wrote: A pipeline creates two or more subshells, one for each command in the pipeline. Therefore, your wait command is running in a different process than

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

2021-06-22 Thread Martin Jambon
On 6/22/21 4:31 AM, Greg Wooledge wrote: On Tue, Jun 22, 2021 at 02:42:40AM -0700, Martin Jambon wrote: I ran into something that looks like a bug to me, although I'm not super familiar curly-brace command groups. Bash version: latest from GitHub mirror (commit ce23728: Bash-5.1 pa

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

2021-06-22 Thread Martin Jambon
On 6/22/21 6:15 AM, Chet Ramey wrote: On 6/22/21 5:42 AM, Martin Jambon wrote: Hello! I ran into something that looks like a bug to me, although I'm not super familiar curly-brace command groups. It's not the brace command; it's the pipeline. Thank you! It's the $$ th

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

2021-06-22 Thread Martin Jambon
Hello! I ran into something that looks like a bug to me, although I'm not super familiar curly-brace command groups. Bash version: latest from GitHub mirror (commit ce23728: Bash-5.1 patch 7) Minimal repro: $ sleep 1 & { wait $!; } | cat [1] 665454 bash: wait: pid 665454 is not a child