bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] New Features for gawk


From: Jeroen Schot
Subject: Re: [bug-gawk] New Features for gawk
Date: Wed, 31 Aug 2011 09:55:11 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Tue, Aug 30, 2011 at 05:03:01PM -0600, Nelson H. F. Beebe wrote:
> Guenter Goebel suggests new gawk options --start-record and --ignore-eof.
> 
> The pattern/action pair
> 
>       (FNR > 2) && /Network is unreachable/ { print $0 }
> 
> should simulate the first, and work with all awk implementations.

You are right, it might be easier to understand/extend if you split
this in two pattern/actions:

   FNR <= 2 { next; }
   /Network is unreachable/
 
> I'm unclear about the purpose of --ignore-eof, but perhaps it too is
> unneeded.

An easy way do this (if I understand correctly) is by chaining tail
and gawk as the creators of UNIX intended:

  tail -n +0 -f logfile | gawk '...'

So it seems both new options can easily be simulated with our current
*NIX tools. 

Regards,
-- 
Jeroen Schot



reply via email to

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