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

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

gnu grep - no bug report but feature suggestion (dunno if right here, s


From: Erhard Schwenk
Subject: gnu grep - no bug report but feature suggestion (dunno if right here, sorry)
Date: Sun, 11 Nov 2001 18:27:26 +0100

Hello,

I do not know if this is the right place to make a suggestion about a
simple new feature for GNU grep but I did not find any other place for
it so I just try :-).

Today I needed to filter some output for Data and came about the problem
to do something like

grep -e '([0-9]{1;3}.){3}[0-9]{1;3}' mydata

to get out an IP-address from data. Now I did not need the whole line
where it is but just the String that matched the Expression - and so I
studied the grep manpage and found out: there seems to be none. Maybe I
just did not see it, but reading the whole thing again did not show so.

I mean, there are options to get the line with the Match, lines bevore
and after the Match, lines without the Match, the filename of the Match
and the position of the Match, the count of Matches at all - but no
simple Way to get just the Matching Text itself and nothing else.

Of course, I solve my Problem by using sed, but I decided to suggest to
you to implement an additional command line Switch to grep to make this
possible, too since it was intuitively the first Place I would look for
something like this. Since one can already get the position of the Match
I do not think this should be very much work to implement - I am sorry I
cannot provide you a patch already because my programming skills in C
are not so high.

-- 
Erhard Schwenk
http://www.fto.de - http://www.akkordeonjugend.de

No Spam replies please.



reply via email to

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