On 3/12/24 7:29 AM, Greg Wooledge wrote:
hobbit:~$ bash -c 'set +m; for i in {0..3}; do sleep 1 & done; for i in {0..3}; do wait -n -p pid; e=$?; printf "pid %s status %s\n" "$pid" "$e"; done' pid 530407 status 0 pid 530410 status 0 pid status 127 pid status 127
Thanks for this example. This case is one where bash aggressively marks terminated jobs as notified, making them eligible for removal from the jobs list. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/