bug-grep
[Top][All Lists]
Advanced

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

Re: Bug or feature?


From: Wacek Kusnierczyk
Subject: Re: Bug or feature?
Date: Thu, 23 Jun 2011 01:06:45 +0200
User-agent: RoundCube Webmail/0.4-trunk

On Wed, 22 Jun 2011 16:47:21 -0600, Eric Blake <address@hidden>
wrote:
> On 06/22/2011 04:43 PM, Eric Blake wrote:
>> On 06/22/2011 04:25 PM, Eric Cloninger wrote:
>>> # echo " 1 2 3 4" |grep -o "^ [0-9]"
>>>  1
>>>  2
>>>  3
>>>  4
>>>
>>> It would appear that -o chops up the input stream into a new line every 
>>> time a match is found.  However, I expect a "^...." grep to find only one 
>>> result per line of input, regardless of the return method (whole line or 
>>> only-matching).  Bug or feature?
>>
>> Which version of grep?
>>
>> $ echo " 1 2 3 4" | grep -o '^ [0-9]'
>>  1
>> $ grep (GNU grep) 2.8
>>
>> and likewise for 2.9.
> 
> Followup - I can reproduce the bug with grep 2.5.1 on RHEL 5, but I
> don't see a NEWS entry that looks like it would explain why it is now
> working.

Got the same issue with 2.5.1 on Mac OS X.

vQ



reply via email to

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