buggrep - Bugs: bug #22100, Enhancement request: "grep...

 
 

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

bug #22100: Enhancement request: "grep foo | grep bar" in one process (i.e. line-selector and pattern selector)

Submitted by:  Richard Neill <richardneill>
Submitted on:  Thu 24 Jan 2008 04:45:22 AM UTC  
 
Category: NoneSeverity: 1 - Wish
Item Group: NoneStatus: Wont Fix
Privacy: PublicAssigned to: None
Open/Closed: Closed

Thu 02 Dec 2010 09:24:34 PM UTC, comment #1:

See

http://permalink.gmane.org/gmane.comp.gnu.grep.bugs/3399
http://permalink.gmane.org/gmane.comp.gnu.grep.bugs/3400

(which got lost in the savannah crash)

Paolo Bonzini <bonzini>
Thu 24 Jan 2008 04:45:22 AM UTC, original submission:

I frequently find myself writing a construct of the type:
grep LINE_MATCH filename | grep -oE WORD_MATCH

For example, consider a data file:

apples: 12
oranges: 15
bananas: 20

How many oranges do I have?

grep oranges fruit.txt | grep -oE [0-9]+

results in "15".

But I had to run 2 instances of the grep command, which is inefficient. (This is noticeable even for small files, even on a fast machine).

So my proposal is to have some extra options to grep, eg:
grep --line oranges --pattern -oE [0-9]+ fruit.txt

Alternatively, what about allowing multiple instances of -E, or supporting --first --second --third ?

Thanks very much,

Richard

Richard Neill <richardneill>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bonzini (Updated the item)
  • -unavailable- added by richardneill (Submitted the item)
  • -unavailable- added by richardneill
  •  

    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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 02 Dec 2010 09:24:34 PM UTCbonziniStatusNone=>Wont Fix
      Open/ClosedOpen=>Closed
    Fri 04 Dec 2009 07:23:45 PM UTCbonziniSeverity3 - Normal=>1 - Wish
    Thu 24 Jan 2008 04:45:22 AM UTCrichardneillCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1