public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* shell expansion produces e.g. "ls: cannot access '*.pdf': No such file or directory" in Windows CMD shell, but works okay in bash
@ 2020-03-22 17:50 Jay Libove
  2020-03-22 19:08 ` Paul Moore
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Jay Libove @ 2020-03-22 17:50 UTC (permalink / raw)
  To: cygwin

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@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


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-03-28 12:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-22 17:50 shell expansion produces e.g. "ls: cannot access '*.pdf': No such file or directory" in Windows CMD shell, but works okay in bash Jay Libove
2020-03-22 19:08 ` Paul Moore
2020-03-22 19:27   ` Jay Libove
2020-03-22 19:41     ` Paul Moore
2020-03-22 19:54       ` Jay Libove
2020-03-22 20:15         ` Paul Moore
2020-03-23 17:43         ` Andrey Repin
2020-03-23 18:34           ` Jay Libove
2020-03-23 19:13             ` Andrey Repin
2020-03-24  7:57               ` Thomas Wolff
2020-03-23 23:04             ` Marco Atzeri
2020-03-22 19:10 ` Marco Atzeri
2020-03-22 19:15   ` Paul Moore
2020-03-28 12:21 ` Andrey Repin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).