[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#45432: Use both --include and --exclude at the same time
From: |
Paul Jackson |
Subject: |
bug#45432: Use both --include and --exclude at the same time |
Date: |
Thu, 07 Jan 2021 00:51:43 -0600 |
User-agent: |
Cyrus-JMAP/3.3.1-61-gb52c239-fm-20201210.001-gb52c2396 |
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@usa.net