public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: jeff <jeff@jeffunit.com>
To: "cyg >> The Cygwin Mailing List" <cygwin@cygwin.com>
Subject: Re: wildcards don't work in directory with files with odd characters
Date: Mon, 18 May 2020 11:10:21 -0700	[thread overview]
Message-ID: <231407d0-fd87-01f4-0fd1-6948448950be@jeffunit.com> (raw)
In-Reply-To: <CA+kUOakpSETMesmnnnazr+50r37tCJ0Ua=+LOXsEdtaEC0=cTQ@mail.gmail.com>

On 5/18/2020 11:03 AM, Adam Dinwoodie wrote:
> On Mon, 18 May 2020 at 17:21, jeff wrote:
>> On 5/18/2020 8:55 AM, Andrey Repin wrote:
>>> Greetings, jeff!
>>>
>>>> I have a directory that has some files with odd files.
>>>> I can do a 'ls', successfully. However if I do a 'ls *'' I get:
>>>> ls: cannot access '*': No such file or directory
>>>> Here is ls output:
>>>> 'Highlander-S03E21-Final'$'\303\251''_Part_I-22.mkv'
>>>> 'Highlander-S03E22-Final'$'\303\251''_Part_II-23.mkv'
>>>> I am pretty sure this used to work.
>>>> This is not specific to ls. wc has the same behavior for example.
>>> Are you trying to run it from Cygwin shell or from some native one, like cmd?
>>>
>> I am running from windows 'command prompt' aka cmd. When run from bash
>> everything seems to work correctly.
> In which case this is expected behaviour: Cygwin's `ls` expects the
> shell (e.g. Bash) to expand globs like `*`, but Windows' command
> prompt expects applications to handle expanding globs (or the Windows
> equivalents thereof) themselves. When you call a Cygwin command like
> `ls` directly from the Windows command prompt, Windows passes the
> arguments as-is to the Cygwin command, and the Cygwin command assumes
> that the arguments it received are already appropriately expanded.
>
> If this was working previously, I can only assume it's because you
> were calling Windows' `ls` (which I seem to recall exists and is
> essentially an alias for `dir`), which expects Windows semantics and
> therefore handles its own expansions.
If the directory doesn't contain any files with odd characters in the 
name, then
'ls *' run from cmd works just fine. Only when there are odd characters 
in the file name is there an issue.

thanks,
jeff



  reply	other threads:[~2020-05-18 18:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 12:40 jeff
2020-05-18 15:55 ` Andrey Repin
2020-05-18 16:21   ` jeff
2020-05-18 18:03     ` Adam Dinwoodie
2020-05-18 18:10       ` jeff [this message]
2020-05-18 20:01       ` David Macek
2020-05-18 20:12         ` jeff
2020-05-19 10:49     ` Andrey Repin
2020-05-19 19:08       ` Chris Wagner
2020-05-19  2:04 ` Chris Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=231407d0-fd87-01f4-0fd1-6948448950be@jeffunit.com \
    --to=jeff@jeffunit.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).