buggrep - Bugs: bug #8243, egrep with --color and -f...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #8243: egrep with --color and -f patternfile gives different result to fgrep

Submitter:  None
Submitted:  Mon 22 Mar 2004 02:26:37 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Thu 10 Nov 2005 08:27:24 PM UTC, comment #2: 

This issue has been addressed by patch #4604.

Charles Levert <charles_levert>
Thu 28 Oct 2004 06:33:42 PM UTC, comment #1: 

For the trials mentioned, there should exist the following file named "pattern" containing three lines:

> cat pattern

runs
one
test

The output, with highlighting indicated by parentheses, is:

> echo -e "one two test runs here\nok runs one test one" | egrep --color=auto -f pattern

one two test (runs) here
ok (runs) (one) test (one)

> echo -e "one two test runs here\nok runs one test one" | fgrep --color=auto -f pattern

(one) two (test) (runs) here
ok (runs) (one) (test) (one)

The output of the first trial (using egrep) is wrong: it should highlight all occurrences of "runs", "one" and "test", like the second trial (using fgrep) which is correct.

The same results occur with "-e runs -e one -e test" instead of "-f pattern".

The equivalent results occur with "--only-matching" instead of "--color".

Julian Foad <julianfoad>
Mon 22 Mar 2004 02:26:37 PM UTC, original submission:  

grep-2.5.1

Try:

echo -e "one two test runs here\nok runs one test one" | egrep --color=auto -f pattern

echo -e "one two test runs here\nok runs one test one" | fgrep --color=auto -f pattern

The egrep output highlights occurrences of 'runs' and 'one' only.  The fgrep output highlights occurrences of 'runs', test', and 'one'.

Is this difference intentional?

Original bug report:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=118716

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-11-10 charles_levert StatusNone Fixed
    Open/ClosedOpen Closed
2004-03-24 twaugh Carbon-Copy- Added twaugh

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code