[Moving to -workers] On Sat, Mar 26, 2022 at 3:19 PM Bart Schaefer wrote: > > > Anyways, zargs is not doing a stellar job currently with collecting > > exit statuses from commands ran in parallel: > > There might be something more that could be done now, to > pick up the status of the rest ... but I'm reluctant to mess with that > while the segfault is unfixed. I found a different reproducer for the segfault, and had an idea about zargs, so ... I messed with it ... > Hmm ... zargs uses > wait ${${jobstates[(R)running:*]/#*:/}/%=*/} $jobstates can be avoided by collecting the values of $! in a local array. > However, that "wait" returns the exit status of only one As noted in the comments in (the current iteration of) zargs, "wait $j1 $j2 $j3 ..." waits for all those jobs and returns the status of whichever one exits last. However, "wait" with no arguments places all the exit status in the internal list of exited jobs, after which the statuses may be collected individually by "wait $j1; wait $j2; wait $j3". It's not possible to wait for the same specific job more than once, so it doesn't work to first wait for a list of jobs and then wait again for each of them.