GNU bug report logs - #45432
Use both --include and --exclude at the same time

Previous Next

Package: grep;

Reported by: "Fred .Flintstone" <eldmannen <at> gmail.com>

Date: Fri, 25 Dec 2020 16:57:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Paul Jackson" <pj <at> usa.net>
To: bug-grep <at> gnu.org
Subject: Re: bug#45432: Use both --include and --exclude at the same time
Date: Thu, 07 Jan 2021 00:51:43 -0600
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.