Re: [Help-bash] How to forbidden SIGINT be propagated from the parent sc
From:
Chet Ramey
Subject:
Re: [Help-bash] How to forbidden SIGINT be propagated from the parent script to the child script?
Date:
Sat, 30 May 2015 13:50:45 -0400
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
On 5/29/15 12:20 PM, Peng Yu wrote:
> On Fri, May 29, 2015 at 10:03 AM, Greg Wooledge <address@hidden> wrote:
>> On Fri, May 29, 2015 at 09:48:05AM -0500, Peng Yu wrote:
>>> Is there a way to make any scripts (any their child scripts) called by
>>> the main script not responsive to Ctrl-C?
>>
>> The obvious way is to ignore SIGINT:
>>
>> trap '' INT
>
> I works for this test case 1 but not test case 2. Do you know why?
> What is the difference in case 2?
One obvious difference is that case 2 invokes `R', while case 1 invokes
sleep/wait. Who knows what R is doing with the SIGINT, since there's
nothing stopping R from installing a signal handler for it? (The
`execution halted' message does provide a hint that it installs one.)
--
``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/