emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#17763: closed (grep --exclude does not match files


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#17763: closed (grep --exclude does not match files as documented in man page)
Date: Fri, 11 Jul 2014 20:25:02 +0000

Your message dated Fri, 11 Jul 2014 13:23:56 -0700
with message-id <address@hidden>
and subject line Re: bug#17763: grep --exclude does not match files as 
documented in man page
has caused the debbugs.gnu.org bug report #17763,
regarding grep --exclude does not match files as documented in man page
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
17763: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17763
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: grep --exclude does not match files as documented in man page Date: Thu, 12 Jun 2014 12:05:52 +0000

It seems file globbing as done by ‘grep --exclude’ is broken when wildcards are used.

 

$ echo foo >bar

$ grep --exclude='.*' . ./bar

$ grep --exclude='.*' . bar

foo

 

Expected behavior: grep –exclude should not exclude bar, whether it is prefixed by ./ or not. According to the man page:

“       --exclude=GLOB

              Skip files whose *base name* matches GLOB (using wildcard matching). […]”

 

This behavior seems to only occur with whenever a directory component of the file path matches the GLOB, e.g.:

$ grep --exclude '.*' . ../bar

$ grep --exclude '.*' . .../bar

$ grep --exclude '.*' . .TEST/bar

$ grep --exclude '.*' . hugues/.TEST/bar

 

The bug triggers with other globs, unless there is no wildcard:

$ grep --exclude 'w*' . work/bar

$ grep --exclude 'work' . work/bar

foo

 

Regards,

 

Hugues Andreux

*************************************************************************
This message and any attachments (the "message") are confidential, intended solely for the addressee(s), and may contain legally privileged information.
Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. 
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or
falsified.
Please visit http://swapdisclosure.sgcib.com for important information with respect to derivative products.
                              ************
Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et susceptibles de contenir des informations couvertes
par le secret professionnel.
Ce message est etabli a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration.
La SOCIETE GENERALE et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie.
Veuillez consulter le site http://swapdisclosure.sgcib.com afin de recueillir d'importantes informations sur les produits derives.
*************************************************************************


--- End Message ---
--- Begin Message --- Subject: Re: bug#17763: grep --exclude does not match files as documented in man page Date: Fri, 11 Jul 2014 13:23:56 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
On 06/12/2014 05:05 AM, ANDREUX Hugues wrote:
According to the man page:
"       --exclude=GLOB
               Skip files whose*base name*  matches GLOB (using wildcard 
matching).

Thanks, I think that's a bug in the documentation, not in the code; grep's behavior is similar to that of tar's, which has similar options. I installed the attached documentation patch.

Attachment: 0001-doc-Document-r-vs-exclude-more-carefully.patch
Description: Text Data


--- End Message ---

reply via email to

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