www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/03/22/15:28:00

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BCE6385E000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1584905232;
bh=/8qVSvwVY77nlk0QhlqZQjfj8US3NFGmwJ66HnTuudo=;
h=To:Subject:Date:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=yPIZnQj7NtsXbSg5sMjBUgJKxsbzKQhpkrn11hYBwm8QtUTPWJEMemw08Q8j5+DXT
uASm6F4d+L7sUCr+OIJOyBy7WFVe3s3LONe0sL4pd58eWxr2NPHEilNZLe5VxyKKOF
fXenIYfF2zt6gOInYE3DrMegZ0pwoKYBxt/U+JGo=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 318C1385E000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=O8jkATrAIJpeW1lmNSjnpTGzYG/T82HFppmJ8MCuRlyzfjBC6js87WNtLvCR/z9w7XkPqwZwLR4qSzO5mCQGM5JrQErEhDmw9jz5LUIA5m4Ia+lU8OorslhFgrH0PaCI1RKHzEhUIr6iidjdjQoNad7F6ZjWvYFhrIqTDpH0mu3i5RmrDdIAAs9xJgkXE9m7KCIZd1NnpvqTTulxUjDrA1UYViv48AIJ6+ryT+t/83ndz2KEt7ft6z7mxekgFG5aDSNzMVCymO1L3BJcSMi2o+IcKsvKbIORi0VQUdYvnqqcZtbII+XzH7WYhfNYCSww935CA+dgLUlP8zCUnSO90g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=QUMSJtcBJ2LV8Vm1WfNQyRNU2ZMKnQ67V/ZHOOQrKy4=;
b=CiQm3fJ04nQ6UIgQv7ZHYvfaN9KPd6UvaUXnw8BIN5Hp0Hji/ZZomzGTwuYg1O/adpIlh2PGzhGgs/Zub+N9TrPvC6FvooqPyeBDGvpX/X0UTFjOTXVxQePPLxM/bqjsEo+SPgLI46bxSZG+XnkXNxLQHffMnyBrFGC5R6WiW9JA5xBUVC2UluTYOvLrfjACcW2U6hKDBse1zkyvvzY6lzxHgxdIManS+7VMxVMH39zcst6V3AyWs8Ch7YniQ3mUd1FukuW/W4zPbqdk8wo5vRVHj+WJA8RCxrk/Ga7iq3j8HOMiYPJmaqr+NedhO/HsuaFjQBNuEo1o6HQGJFfIsQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=felines.org; dmarc=pass action=none header.from=felines.org;
dkim=pass header.d=felines.org; arc=none
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: RE: shell expansion produces e.g. "ls: cannot access '*.pdf': No such
file or directory" in Windows CMD shell, but works okay in bash
Thread-Topic: shell expansion produces e.g. "ls: cannot access '*.pdf': No
such file or directory" in Windows CMD shell, but works okay in bash
Thread-Index: AdYAcaHtFmC5T7LLSdSQBdKKoeqlcgAC6jgAAABAmzA=
Date: Sun, 22 Mar 2020 19:27:06 +0000
Message-ID: <DM5PR13MB0876F96583BE7E4C47AF1E09CBF30@DM5PR13MB0876.namprd13.prod.outlook.com>
References: <DM5PR13MB087674FC4FC989DE45C41E8ECBF30 AT DM5PR13MB0876 DOT namprd13 DOT prod DOT outlook DOT com>
<CACac1F_rKFLb3dCj-ZQPW3CHo3gATo+H4FD+E+PB6y9d+uKN0A AT mail DOT gmail DOT com>
In-Reply-To: <CACac1F_rKFLb3dCj-ZQPW3CHo3gATo+H4FD+E+PB6y9d+uKN0A@mail.gmail.com>
Accept-Language: en-US, en-IE
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [79.158.217.246]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 322163c7-88ab-4aef-7711-08d7ce970209
x-ms-traffictypediagnostic: DM5PR13MB1514:
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <DM5PR13MB1514CE1F9DCD8AF62F285D55CBF30 AT DM5PR13MB1514 DOT namprd13 DOT prod DOT outlook DOT com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 0350D7A55D
x-forefront-antispam-report: SFV:NSPM;
SFS:(10009020)(136003)(346002)(376002)(366004)(39830400003)(396003)(199004)(5660300002)(64756008)(66476007)(26005)(33656002)(8936002)(8676002)(66946007)(66556008)(66446008)(76116006)(81166006)(81156014)(52536014)(508600001)(966005)(186003)(86362001)(2906002)(6506007)(4326008)(7696005)(53546011)(6916009)(55016002)(9686003)(71200400001)(316002)(54906003)(66574012)(460985005);
DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR13MB1514;
H:DM5PR13MB0876.namprd13.prod.outlook.com; FPR:; SPF:None; LANG:en;
PTR:InfoNoRecords; A:0;
received-spf: None (protection.outlook.com: felines.org does not designate
permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: jhov/YCJ1HYoACfsxIjB8HygljahpYFq8rKePnjrUtuwyHkV+Q2AWaH3fGosaSnoaL28QE2yKOz0HASm6tfB8THb5dgtnDEC77Pthhc2jY3//TKhaHlHfu3KFIJcSYd0LO8RFSSf54Em+HMWNH9BIdrLZ3oe2QEyE0Uk7HcLxXdmkUlTHvWUBeAG6K31wT192vprIWWfyUCm9WepXceAFZsBfZfslJz6xF05Ic8AFp9x3eHfSiH+9+Eeq70YQWVP17SoFYJZYsrN7uQAe1vq2ACXWTn6roGn4W9pAabyokMYGFQCpAd4KmwVkBnFYUrPqD9+O5S3ibCliVmF2PSd32nN1LSv3oOGtE3mgaip2aNArgyr0bRMy0DaZfWfiJn2N/XN1Zjio0LOvW7q3B2c7apvpxG+2Ui5bmwJspPGVMiefYRUcDar5M0Gd1mXs5i7kLR89cE6WJqcy7PTFWwOgo6IOOALoJpAQ5M13O5U9UVCqj8vBBA61C3Wqx6n1yefTERAXHG81CHO9UbMflt8QPa1wrwDKUhzaGOzRCFnZ0g0AFUNyt4ePF4Il3Ik6dZF
x-ms-exchange-antispam-messagedata: hWdPgsSrYQEwaKUIYQb1cDrY5ZqRKUCz/hZAbQHojVVc4RVy5fP+nOL1WAm0Vbl9KOp2IrlHeVgbqFUYEAbSrQUJV4N9Zuke49ZedtRK85Bu8uBLXcGXNL3Hi3jcv0jOZMz+AB0skKW8UNomMpBDOw==
MIME-Version: 1.0
X-OriginatorOrg: felines.org
X-MS-Exchange-CrossTenant-Network-Message-Id: 322163c7-88ab-4aef-7711-08d7ce970209
X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Mar 2020 19:27:06.4793 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 6b966328-4f54-442a-8412-308a6127c06b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: WaMIOiEOBlO3QLNnRzdxmd5KMntYFRS6Wjo9KW+GsPsnQbYK12koUbayE/w0ofN7Nvbg6runPtWWfkilLRbZMw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR13MB1514
X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_2, RCVD_IN_DNSWL_NONE,
SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: Cygwin mailing list <cygwin.cygwin.com>
List-Archive: <http://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: <http://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Jay Libove via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Jay Libove <libove AT felines DOT org>
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

Thanks Paul, both for your initial reply, and your follow-up.

In this case it's not a matter case sensitivity. 
I've verified that, in one of the example cases, there are both *.pdf and *.PDF files in the subject directory.
Both 'ls *.pdf' and 'ls *.PDF' produce the "ls: cannot access '*.whatever': No such file or directory" error. 

(Nor, to the other respondent's question, as I pointed out in my original post, is it ACLs, as I did check CACLS before posting).

I also tried copying (using Windows CMD "COPY") *.pdf (so being under Windows, not Cygwin, it matches all cases) from a subject directory to a new test directory.
In the resulting copy in the new test directory, the Cygwin shell expansion problem persists.

Here's an interesting twist:
C:> cd c:\bin\cygwin64\bin
C:> ln gnufind.exe find.exe # I do this to allow me to differentiate between Windows' built-in very limited FIND command, and GNU/Cygwin's far superior find command.
C:> cd \my\test\directory
C:> gnufind . -name *.pdf -print
[ successfully returns all *.pdf {lower case only} files in the subject directory ]
C:> gnufind . -name *.PDF -print
[ successfully returns all *.pdf {upper case only} files in the subject directory ]

I'm pretty sure that Cygwin 'find' does NOT try to emulate shell globbing the way 'ls' does, so it makes sense that this works, and it supports the theory that something weird is going on between how Cygwin does shell expansion when under Windows CMD vs. when fully within the Cygwin environment (under bash where of course bash is doing the shell expansion, and ls or other Cygwin commands don't have to).

Does any of this help pinpoint the problem further?

thanks again,
-Jay

-----Original Message-----
From: Paul Moore <p DOT f DOT moore AT gmail DOT com> 
Sent: Sunday, 22 March 2020 20:09
To: Jay Libove <libove AT felines DOT org>
Cc: cygwin AT cygwin DOT com
Subject: Re: shell expansion produces e.g. "ls: cannot access '*.pdf': No such file or directory" in Windows CMD shell, but works okay in bash

Is this because cygwin globbing is (by default) case sensitive? You could set the CYGWIN environment variable to "glob:ignorecase" to get case-insensitive behaviour.

Paul

On Sun, 22 Mar 2020 at 17:52, Jay Libove via Cygwin <cygwin AT cygwin DOT com> wrote:
>
> I've never seen this before.
> In a Windows CMD shell, Cygwin shell expansion, for example:
> ls *.pdf
>
> returns:
> ls: cannot access '*.PDF': No such file or directory (Indeed, any 
> Cygwin shell expansion, when executed from within Windows CMD, 
> produces this error. See below)
>
> ls *someotherwildcard* (that matches the same .pdf files) DOES return the expected file list.
>
> Example:
>
> C:> DIR *.pdf
> Volume in drive C is C
> Volume Serial Number is 8674-712A
>
> Directory of C:\Temp
>
> 22/03/2020  18:30         1.675.954 test.pdf
> XX/XX/XXXX  XX:XX         {Any many other .pdf files}
>
> Yet:
>
> C:> ls *.pdf
> ls: cannot access '*.pdf': No such file or directory
>
> And:
> C:> bash
> user AT hostname /cygdrive/C/Temp/test
> $ ls *.pdf
> A.pdf
> B.pdf
> {etc}
>
> And, not ALL of the *.pdf files in the particular directory where I've encountered this trigger the problem...
>
> C:> ls N*.pdf
> N.pdf
>
> C:> ls A*.pdf
> ls: cannot access 'A*.pdf': No such file or directory
>
> Nor do all directories containing .pdf files produce this. Of the many thousands of files and directories that I have, only some produce this problem.
> In others, ls *.pdf works perfectly in Windows CMD.
>
> I've looked at the Windows ATTRIB and CACLS of the files in directories where this problem occurs.
> They're all the same. That is, uniform across all files and directories. Nothing interesting.
>
> It's not just 'ls':
>
> C:> cat *.pdf
> cat: '*.pdf': No such file or directory
>
> So, it appears to be Cygwin shell expansion, when executed under Windows CMD, which is provoking this strange behavior.
> Any ideas what could be causing this, and how to solve it?
>
> many thanks,
> Jay
>
> --
> 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
--
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