# `jobs` reaps finished jobs and clears their announce flag, so it must not run # in-process for a command substitution: the shell would lose the job. "$TSH" -c 'sh -c "exit 3" & sleep 0.3; x=$(jobs); jobs' 2>&1 | grep -c Done