bug-bash
[Top][All Lists]
Advanced

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

Re: bug in force_interactive handling


From: Chet Ramey
Subject: Re: bug in force_interactive handling
Date: Mon, 02 Jan 2012 13:27:04 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0

On 1/2/12 4:27 AM, Stas Sergeev wrote:
> 02.01.2012 07:15, Chet Ramey wrote:

>> Thanks, I inadvertently left that part of the patch out of what I sent.
> Will you apply this patch for the next bash release?

Yes, it's already applied.

> In this case it would be nice for bash to have
> a signal that will move the background process
> to the foreground.

But there is already a command to do that: fg.  You can hook SIGCHLD
with a trap handler, process the `jobs' output, and fg the appropriate
process.  I still think that's way more work than you need to do.

> Without this I still can't do
> what I intended: I wanted the script to finish,
> leaving the background process running. This
> works only if my script sleeps till I send SIGCONT
> to the process.

Since you're not really using job control at all, but controlling the
process's status by sending it signals from another process, you
could add a process in between, making the job you're interested in
a grandchild of the shell.  That way it doesn't matter what the shell
does when it exits.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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