Re: BASH_SUBSHELL is not incrementing when part of a pipeline

2023-08-08 Thread Chet Ramey
On 8/7/23 9:56 AM, Kamil Cukrowski Priv wrote: Hi, when BASH_SUBSHELL is part of a pipeline with just a simple command it does not increment. Consider the following: Yes. BASH_SUBSHELL increments for asynchronous commands (&), commands explicitly in subshells, compound commands in pipelines, co

Re: BASH_SUBSHELL is not incrementing when part of a pipeline

2023-08-07 Thread Greg Wooledge
On Mon, Aug 07, 2023 at 01:56:21PM +, Kamil Cukrowski Priv wrote: > Hi, when BASH_SUBSHELL is part of a pipeline with just a simple command it > does not increment. Consider the following: > # docker run -ti --rm bash bash -c 'echo $BASHPID $BASH_SUBSHELL; echo | > echo $BASHPID $BASH_SUBSHELL'

BASH_SUBSHELL is not incrementing when part of a pipeline

2023-08-07 Thread Kamil Cukrowski Priv
Hi, when BASH_SUBSHELL is part of a pipeline with just a simple command it does not increment. Consider the following: # docker run -ti --rm bash bash -c 'echo $BASHPID $BASH_SUBSHELL; echo | echo $BASHPID $BASH_SUBSHELL' 1 0 8 0 Doing anything else, like `echo | { echo $BASH_SUBSHELL; }` or lik