bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] gawk - 'inplace' feature ignores file's access flags (rea


From: Bob Proulx
Subject: Re: [bug-gawk] gawk - 'inplace' feature ignores file's access flags (read-only)
Date: Tue, 16 Jun 2015 13:05:16 -0600
User-agent: Mutt/1.5.23 (2014-03-12)

Andrew J. Schorr wrote:
> These are good points, but I don't think the gawk inplace feature
> actually traps signals.  So your script is better. :-)

:-)

> bash-4.2$ echo hello > test
> bash-4.2$ echo junk >> test
> bash-4.2$ gawk -l select -i inplace '{print $0, "more stuff"; 
> kill(PROCINFO["pid"], "term")}' test
> Terminated
> bash-4.2$ ls -l
> total 8
> -rw-r--r-- 1 schorr ead 11 Jun 16 14:50 test
> -rw-r--r-- 1 schorr ead 17 Jun 16 14:50 test.gawk.J5rOK8

Good catch!  That looks like an bug to me.  It created a temporary
file.  It should clean it up if it is interrupted and can't complete.
This looks like a good bug to report.

(Many programs create and handle temporary files.  The sort command for
example.  There are many examples to pull from.)

> Do sed and perl trap signals properly?

I had thought so.  But I have not looked.

Bob



reply via email to

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