Re: Strange behaviour from jobs -p in a subshell

2018-11-14 Thread Greg Wooledge
> >>> Consider the following script. While the 3 sleeps are running, both jobs > >>> -p and $(jobs -p) will print 3 PIDs. Once the 3 children are finished, [...] ... hey, I think I just figured out the GOAL! You want to run a whole bunch of jobs in parallel, but only 3 at a time. Right? There

Re: Strange behaviour from jobs -p in a subshell

2018-11-14 Thread Chet Ramey
On 11/14/18 4:48 AM, Christopher Jefferson wrote: > > On 13/11/2018 14:59, Chet Ramey wrote: >> On 11/13/18 4:28 AM, Christopher Jefferson wrote: >>> Consider the following script. While the 3 sleeps are running, both jobs >>> -p and $(jobs -p) will print 3 PIDs. Once the 3 children are finished,

Re: Strange behaviour from jobs -p in a subshell

2018-11-14 Thread Christopher Jefferson
On 13/11/2018 14:59, Chet Ramey wrote: > On 11/13/18 4:28 AM, Christopher Jefferson wrote: >> Consider the following script. While the 3 sleeps are running, both jobs >> -p and $(jobs -p) will print 3 PIDs. Once the 3 children are finished, >> jobs -p will continue to print the 3 PIDs of the done

Re: Strange behaviour from jobs -p in a subshell

2018-11-13 Thread Greg Wooledge
On Tue, Nov 13, 2018 at 09:59:51AM -0500, Chet Ramey wrote: > On 11/13/18 4:28 AM, Christopher Jefferson wrote: > > Consider the following script. While the 3 sleeps are running, both jobs > > -p and $(jobs -p) will print 3 PIDs. Once the 3 children are finished, > > jobs -p will continue to

Re: Strange behaviour from jobs -p in a subshell

2018-11-13 Thread Chet Ramey
On 11/13/18 4:28 AM, Christopher Jefferson wrote: > Consider the following script. While the 3 sleeps are running, both jobs > -p and $(jobs -p) will print 3 PIDs. Once the 3 children are finished, > jobs -p will continue to print the 3 PIDs of the done Children, but > $(jobs -p) will only

Strange behaviour from jobs -p in a subshell

2018-11-13 Thread Christopher Jefferson
Consider the following script. While the 3 sleeps are running, both jobs -p and $(jobs -p) will print 3 PIDs. Once the 3 children are finished, jobs -p will continue to print the 3 PIDs of the done Children, but $(jobs -p) will only print 1 PID. $(jobs -p) always seems to print at most 1 PID