- Subject: Re: Question about job control in non-interactive shells
- From: Jilles Tjoelker <jilles@xxxxxxxx>
- Date: Fri, 13 Jan 2012 16:49:26 +0100
- Cc: Michael Welsh Duggan <mwd@xxxxxxxx>, dash@xxxxxxxxxxxxxxx
- In-reply-to: <20120109163745.GA23825@burratino>
- User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Jan 09, 2012 at 10:37:45AM -0600, Jonathan Nieder wrote:
> Michael Welsh Duggan wrote:
> > I am trying to determine why:
> > dash -c "sleep 5 & kill %1"
> > results in:
> > dash: 1: kill: No such process
> You are probably looking for the -m option.
The cause is that the -m option ("job control") enables running commands
in separate process groups, and dash follows literally what POSIX says
about kill %job: a background process group should be signaled; however,
there is no background process group. Some shells signal one or more
processes they know are part of the job in this case, but dash calls
kill() on a process group that is guaranteed not to exist.
--
Jilles Tjoelker
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[LARTC]
[Bugtraq]
[Yosemite Forum]
[Photo]