Le Sun, 8 Jul 2012 15:23:55 +0000 (UTC) Thorsten Glaser <[email protected]> a écrit:
> Aah. You are using the job commands in a noninteractive script. > > Please read up on $! instead, and remember that everything with > %% and friends needs job control. Ok. In fact mksh works like dash in this case... but even with the "set -m" option mksh still ignores it, by there. BTW, I recently submitted on the dash ML the idea that kill could reach "%" jobs independently from the state of the job control flag. As a matter of fact, if it's not a requirement, POSIX seems to encourage it: The jobs utility is not dependent on the job control option, as are the seemingly related bg and fg utilities because jobs is useful for examining background jobs, regardless of the condition of job control. When the user has invoked a set +m command and job control has been turned off, jobs can still be used to examine the background jobs associated with that current session. Similarly, kill can then be used to kill background jobs with kill% <background job number>. http://pubs.opengroup.org/onlinepubs/009695399/utilities/jobs.html (RATIONALE section) >From what I've seen of their POSIX interpretation, I've probably a very few chances to be heard, but... who knows? > >Good to know about sleep, thanks. I'm surprised, though, about the > >signal numbers on Linux, because they are POSIX and properly > > Not all of them. Amount(!) of signals, order and names differ > even across various CPU architectures on Linux. > > (Not to mention I use BSD, which differs from Linux, too. We > have SIGINFO, for example, which rocks.) Not all of them, indeed... but as far as it makes sense I try to stick with POSIX shell for scripting. :) ++ Seb.
