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

Submitted by:  None
Submitted on:  Mon 22 Mar 2004 02:26:37 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned 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

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Thu 10 Nov 2005 08:27:24 PM UTCcharles_levertStatusNone=>Fixed
  Open/ClosedOpen=>Closed
Wed 24 Mar 2004 09:49:00 AM UTCtwaughCarbon-Copy-=>Added twaugh

Back to the top


Powered by Savane 3.1-cleanup1