public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@yandex.ru>
To: L A Walsh <cygwin@tlinx.org>, cygwin@cygwin.com
Subject: Re: bug report: shell expansion in argv[] processing sensitive to LANG, e.g.  "ls: cannot access '*.pdf': No such file or directory", but works okay in bash
Date: Thu, 2 Apr 2020 16:43:57 +0300	[thread overview]
Message-ID: <117150818.20200402164357@yandex.ru> (raw)
In-Reply-To: <5E85899A.9090408@tlinx.org>

Greetings, L A Walsh!

> On 2020/03/24 00:18, Jay Libove via Cygwin wrote:
>> Problem:
>> Under certain circumstances (see Steps to Reproduce, below) Cygwin programs' built-in argv[] globbing will produce unexpected:
>> "{programName}: cannot access '{glob pattern}: No such file or directory"
>> e.g.
>> "ls: cannot access '*.pdf': No such file or directory"
>> .. despite the fact that e.g. *.pdf definitely exists.
>>   
> ----
>     This isn't a bug or a problem, it is working normally as expected.
> Cygwin programs don't have built-in argv[] globbing or processing.

>     The problem you are seeing is because you are calling cygwin programs
> from a windows shell.

>     On windows, every program has to be built with glob processing.

>     On unix, glob processing happens in the shell, so all unix 
> (linux+cygwin)
> type programs have no glob processing because they know that globbing is 
> built
> into the shell (like bash or csh, or dash, etc).

> If you run 'ls' *.pdf in bash, bash expands the *.pdf into arguments
> that don't contain a glob (if the glob matches a file).  So 'ls' sees
> only fixed filenames and no globs.

> When you run 'ls from the Windows shell, Windows cmd.exe doesn't expand
> glob chars into anything.  so 'ls' sees a literal file name of '*.pdf'.

> On linux you can name a file '*.pdf' (using an asterisk as a valid 
> character).
> Unless you have a file named, literally '*.pdf', ls won't see it.

That's not what actually happens.

...\Documents> ls -1 *.pdf
21927-ticket.pdf
'Stars! Universe Map.pdf'


-- 
With best regards,
Andrey Repin
Thursday, April 2, 2020 15:51:26

Sorry for my terrible english...


  reply	other threads:[~2020-04-02 13:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24  7:18 Jay Libove
2020-03-24  9:07 ` Thomas Wolff
2020-03-24  9:27   ` Mark Geisert
2020-04-02  6:43 ` L A Walsh
2020-04-02 13:43   ` Andrey Repin [this message]
2020-04-02 16:30     ` L A Walsh

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=117150818.20200402164357@yandex.ru \
    --to=anrdaemon@yandex.ru \
    --cc=cygwin@cygwin.com \
    --cc=cygwin@tlinx.org \
    /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).