GNU bug report logs -
#45432
Use both --include and --exclude at the same time
Previous Next
Full log
View this message in rfc822 format
Being an old school geek, I recommend using the "find" command,
perhaps piped to "xargs grep", to control which files to grep.
The find command has a more general syntax for logically choosing
files, by any property of name, path or stat fields, with possible nested
and, or and not predicates, as needed.
However ... I learned how to use find, xargs and grep long before grep
had any such options as --include and --exclude, so I should probably
be ignored as not contributing to the current discussion.
Carry on ... <chuckle>.
P.S. -- Best use "find -print0" and "xargs -0", in order to avoid some
ancient and regrettable nasty irregularities in how xargs otherwise
handles embedded spaces and unbalanced quotation marks in the
input stream.
See my xargs wrapper for a convenient workaround for this nastiness:
http://thepythoniccow.us/x.c.txt
--
Paul Jackson
pj <at> usa.net
This bug report was last modified 4 years and 129 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.