Bug 144980 - Bug in special character ^ matching with -o and -c
Bug in special character ^ matching with -o and -c
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: grep (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-13 06:33 EST by E. Choroba
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-01-13 07:10:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description E. Choroba 2005-01-13 06:33:18 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20041020

Description of problem:
Grep does not recognise beginning of a line when using the "matching
part" switches. If the line really matches the given pattern, then
grep tries to match the pattern in the line with the last match
deleted (try the following line: 
 $ echo aa | grep -o ^a
Expected result is
 a
while grep gives
 a
 a
which is a bug. Similarly,
 $ echo ab | grep -o ^.
should return
 a
but returns
 a
 b


Version-Release number of selected component (if applicable):
grep-2.5.1-31.2

How reproducible:
Always

Steps to Reproduce:
1. Run grep -c or grep -o. Use the special character ^ in the regular
expression.
2. If there is a matching line that contains the pattern more than
once with no other characters between the matches, all the matches are
written out.

Additional info:
Comment 1 Tim Waugh 2005-01-13 06:52:23 EST
This happens with pristine 2.5.1a as well.
Comment 2 Tim Waugh 2005-01-13 07:10:02 EST
Reported upstream:
https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=11579

Note You need to log in before you can comment on or make changes to this bug.