bug-gawk
[Top][All Lists]
Advanced

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

[bug-gawk] -i infile unexpected behavior


From: Ed Morton
Subject: [bug-gawk] -i infile unexpected behavior
Date: Sun, 15 Mar 2015 11:19:16 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

I don't believe this is the way `-i infile` (http://www.gnu.org/software/gawk/manual/gawk.html#Extension-Sample-Inplace) should work:
$ cat file
foo
$ awk -i infile 'END{print "bar"}' file
bar
$ awk -i infile 'ENDFILE{print "bar"}' file
bar
$ cat file
foo
I expected "bar" to get written to "file" in both the `END` and `ENDFILE` conditions, not printed to stdout. I'm on cygwin:
$ gawk --version
GNU Awk 4.1.1, API: 1.1 (GNU MPFR 3.1.2, GNU MP 6.0.0)
Regards,

    Ed.



reply via email to

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