[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

jobs race condition

From: Grisha Levit
Subject: jobs race condition
Date: Mon, 16 May 2016 19:16:43 -0400

I would expect the following loop to exit after one (or maybe two) iterations but it runs until PIDs get recycled:

$ : & while [[ $(jobs) ]]; do :; done
[1] 61589
TRACE: pid 51259: delete_old_job: found pid 61589 in job 0 with state 4

The loop does not terminate because jobs just keeps printing [1]+ Done :.

Hitting ^C during this loop sometimes puts the shell in a really weird state, with half the output echoed back and half seemingly going to readline but not echoed back. Sometimes bash: wait_for: No record of process xxxxx is printed.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]