bug-bash
[Top][All Lists]
Advanced

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

Re: bizarre trap behavior while reading a file


From: Chet Ramey
Subject: Re: bizarre trap behavior while reading a file
Date: Mon, 28 Mar 2011 11:45:44 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.14) Gecko/20110221 Thunderbird/3.1.8

On 3/28/11 11:39 AM, tytus64 wrote:

>> There is a bash process that is forked to execute the `while read ...'
>> in the first pipeline loop.  It has to hang around the whole time, so it
>> can run the while loop and exit with the correct status.  If you send it
>> a SIGHUP with `killall bash', it will exit.
>>
> 
> Thanks for all the answers. I think I understand the problem now. I wonder
> though if there is any way to disable default HUP handling int the
> subprocess executing the loop?

Sure.  Trap it to SIG_IGN: `trap "" SIGHUP'.


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



reply via email to

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