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    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to