bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: [PATCH] [RFC] add support for input/output count of lines


From: Stepan Kasal
Subject: Re: [PATCH] [RFC] add support for input/output count of lines
Date: Fri, 1 Oct 2004 10:27:37 +0200
User-agent: Mutt/1.4.1i

Hello,

On Fri, Oct 01, 2004 at 09:48:47AM +0200, Roberto Nibali wrote:
> $ grep --input-lines --output-line foobar /var/log/really_big_file

thank you for your patch, and thank you for sharing the idea with us.

But the same can be achieved by awk, eg.

gawk '
  /foobar/ {c++; print}
  END {
    printf("input_lines=%d\noutput_lines=%d\n", NR,c) >"/dev/stderr"
  }'

The only gawk-specific feature is the redirection to "/dev/stderr".
You can use a temporary file, to get portable solution.

But yes, awk uses a bit different syntax of regular expressions then
either grep or egrep.

So my first impression is not to include your patch.
But I'd also like to hear opinions from other people on the list.
(Perhaps off the list, I'll publish a summary.)

BTW: Even if the feature were accepted, I'd hesitate to grant the
one-letter options, but that's not relevant at the moment.

Sorry,
        Stepan Kasal




reply via email to

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