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

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

Re: grep feature request: show column numbers


From: Stephane Chazelas
Subject: Re: grep feature request: show column numbers
Date: Tue, 14 Dec 2004 09:51:08 +0000
User-agent: Mutt/1.5.6i

On Tue, Dec 14, 2004 at 06:12:03AM +1100, Martin Pool wrote:
> I realize I can write it in awk, or rather more simply in 
> Perl/Python/Ruby.  You could say the same of half of the features of GNU 
> grep.  My point is that it would be a useful addition, and in my opinion 
> as relevant as other options such as --color.
> 
> I didn't realize GNU suddenly had a policy of strict minimalism. ;-)
[...]

Note that I replied but am in no way a GNU grep maintainer.

I am one to think that grep should do only what it is supposed
to do:

To my mind:

grep -r --include --exclude

is not grep's job.

listing files is the job of another command (find, tw, shell).


Today, you'd like an option to report the column, but what about
tomorrow an option for the length of the matched portion, or to
report only the first n chars, or to do some arithmetics on
it... you'll end up with a grep looking very much like... awk.

On the other hand, you may argue that as grep is more or less a
subset of awk, what's the need for it anyway? I guess the answer
is that as it's been designed to do a simple and only task, it
can do it efficiently, but I guess it's less of an argument
nowadays.

-- 
Stéphane





reply via email to

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