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


View this message in rfc822 format

From: "Fred .Flintstone" <eldmannen <at> gmail.com>
To: 45432 <at> debbugs.gnu.org
Subject: bug#45432: Use both --include and --exclude at the same time
Date: Fri, 25 Dec 2020 14:17:32 +0100
[Message part 1 (text/plain, inline)]
Hi,

It seems --exclude does nothing when --include is used. It would be useful
to be able to use both together, in order to do things such as recusively
grepping files of a certain file extension while excluding certain
directories.

Example:
$ grep --recursive --include="*.cs" --exclude="*/tests/*"
[Message part 2 (text/html, inline)]

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.