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: Fri, 25 Mar 2011 23:37:09 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7

On 3/25/11 5:25 PM, tytus64 wrote:
> 
> I started execution of the following script and and repeatedly sent a SIGHUP
> to it from another shell. If SIGHUP is received within the first while loop
> the loop terminates with "wc -l" printing fewer than 4158 lines. If SIGHUP
> is received within the second while loop the loop still continues and the
> second "wc -l" prints always 4158 lines.
> 
> I am really curious why is this happening!!!

You don't say anything about what version of bash you're using or what OS
you're on, but I couldn't reproduce it.

I modified the script to print $$ at the beginning, so I knew which pid
to hit, and hammered it with kill -HUP pid from another terminal.  Each
loop consumed and wrote 4158 lines.

I tried it on both Mac OS X and RHEL 4 with the same results.

Chet

-- 
``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]