[Top][All Lists]

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

[sr #104682] files whose content matches all given regular expressions

From: Julian Foad
Subject: [sr #104682] files whose content matches all given regular expressions
Date: Sat, 24 Sep 2005 22:37:00 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511

Update of sr #104682 (project grep):

                  Status:                    None => Wont Do                
             Open/Closed:                    Open => Closed                 


Follow-up Comment #1:

This is not really Grep's job.  On Unix-like systems, the command for finding
files which match a certain set of conditions is "find".  Your example can be
achieved by this command:

find *.c *.h -exec grep -q gnu {} \; exec grep -q author {} \; -print

I know that's longer, and I know Grep already has the "list files that [do
not] contain a match" options, but if we were to try to extend Grep further
in this direction, we would also want to be able to find files that contain
"gnu" but not "author", files that contain "gnu" or "author", and so on.  We
would end up with a set of features like the "find" command has.

That's why we try to keep the functionality of different programs separate.

When you want a particular combined behaviour, but don't want to type the
combined "find"+"grep" command out in full, writing and using your own script
that does exactly what you want is exactly the right thing to do.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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