delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/09/03/09:27:02

DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 483DR2x01727732
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=wGiJOMQp
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A0F493860008
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1725370021;
bh=OmWsz8AdVwrYACdNPnAPv4Nv/oSxqZvc4+7fXg1H1Do=;
h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=wGiJOMQpR6BQNpAcidlE5H+d6eapucb3nTvryMRyrKm5xA3+xdySHNuMmmID2RwgK
7UET/V2vaIPWfu5pDKLwT0Hl3S9d/ZP6o0i/l1hgQsqV9jOOEMSwUD3DhfPXppdwQO
uyQZ5HxHRasi7k29PMGLji1fSsN0WUPoxehJ5akw=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DEEE9385DDCA
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DEEE9385DDCA
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725369966; cv=none;
b=IusMQWdfc3nWimakfej1QzAHQYS+nar0kP8FlJ0QmaC7k4z8XiX8V5Si0czB155/Nmfcdsxwrt7D8BLVMUwq2sZm4XbNblOWNTUJH3wtxkx9oaljsKWCvsWxUNozumpEmvX6/Z+UNcjm8UEsfy6ebln9QjHAECBxqj8pq8iMxQU=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1725369966; c=relaxed/simple;
bh=dDzv8uFDj6uoGFC3sNL0zvkVsPSHAUJ1MnPOmwzQuqQ=;
h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From;
b=oyWUk2Ot25Zx/NGyYdHmjxDptuMTHKKIjfxhmdukJ59CJHNAN9ebQZoIiDA0Oo6phgln92wQLRXREZP5vzbVOCavLzSNo7Y7DayGEhhCBDtUJOWWkBQi7dZbbcbEZXuo9rPCQlT2O3mOGcWVg492c1ndGXBT8ugHdwTk9/XaCD4=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-ASG-Debug-ID: 1725369962-24039d16a31105ff0001-w5GHUG
X-Barracuda-Envelope-From: moss AT cs DOT umass DOT edu
X-Barracuda-RBL-Trusted-Forwarder: 128.119.240.136
DKIM-Filter: OpenDKIM Filter v2.11.0 mailsrv.cs.umass.edu 741245BDC8
X-Barracuda-RBL-Trusted-Forwarder: 192.168.50.223
Message-ID: <c94d090c-fed5-4950-4ef1-9e3f00b7bf3a@cs.umass.edu>
Date: Tue, 3 Sep 2024 09:26:02 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Subject: Re: case-insensitive filename comparisons
X-ASG-Orig-Subj: Re: case-insensitive filename comparisons
To: Rich Draves <richdr AT microsoft DOT com>,
"cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
References: <SA6PR21MB418042E1047C318B59BAB072C7932 AT SA6PR21MB4180 DOT namprd21 DOT prod DOT outlook DOT com>
In-Reply-To: <SA6PR21MB418042E1047C318B59BAB072C7932@SA6PR21MB4180.namprd21.prod.outlook.com>
X-Barracuda-Connect: mailsrv.cs.umass.edu[128.119.240.136]
X-Barracuda-Start-Time: 1725369962
X-Barracuda-Encrypted: TLS_AES_256_GCM_SHA384
X-Barracuda-URL: https://barramail.cs.umass.edu:443/cgi-mod/mark.cgi
X-Barracuda-BRTS-Status: 1
X-Virus-Scanned: by bsmtpd at cs.umass.edu
X-Barracuda-Scan-Msg-Size: 1290
X-Barracuda-Spam-Score: 0.00
X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0
QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.7 tests=
X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.129935
Rule breakdown below
pts rule name description
---- ---------------------- --------------------------------------------------
X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, JMQ_SPF_NEUTRAL, NICE_REPLY_A, SPF_HELO_NONE,
SPF_PASS, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Eliot Moss via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Eliot Moss <moss AT cs DOT umass DOT edu>
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

On 9/3/2024 9:13 AM, Rich Draves via Cygwin wrote:

> I often use grep -r --include. But it has a really annoying problem - the
> comparison of the filename is case-sensitive. The -i option seems to apply
> only to the regex not the filename matching.

> For example, I have many files named virtualenvironment.ini. But
> unfortunately, sometimes it is virtualEnvironment.ini,
> VirtualEnvironment.ini, etc.

> Grep -r --include=virtualenvironment.ini skips the latter files. As a
> work-around, I use --include="[Vv]irtual[Ee]nvironment.ini" but this is
> cumbersome and not a complete solution.

> Because Windows is case-insensitive/case-preserving, I think the Cygwin
> filename matching should also be case-insensitive. Am I missing something
> here?

Maybe ... Cygwin is trying to act as closely as possible to Posix behavior as
it can when running under Windows.  AFAIK, Posix does not offer
case-insensitive filename matching for grep.  While it's more cumbersome,
depending on the filenames you desire to match against, you could do something
like:

grep your-regex $(find . -iname 'virtualenvironment.ini')

The -iname operator of find asks it to do a case-insensitive filename match.
See also its -ipath and -iregex operators.

Regards - Eliot Moss

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019