X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1B612388A016 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=anrdaemon AT yandex DOT ru DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1585835402; bh=LkyjFqBHe9BNl8Jv83wpeqPDB/uceDVGK5gEOs/XJc8=; h=In-Reply-To:Subject:To:Reply-To:From:Message-ID:References:Date; b=hsLKoeI+SUpDU74VUaxlgxnBkHAYYchmcTLXBShZTDBN3dY+LqLcu20uSXhIySK1d s8k6PHDzi2p8u7EIl3zRb8cCtJCdTCPgRFQKJw77k6Di5PvHViDZnDScRlEvW3Zp2H kyC7bv1cDheNa/nO83GbyYSXEaJi679KdU0s2aqk= Authentication-Results: mxback8q.mail.yandex.net; dkim=pass header.i=@yandex.ru Date: Thu, 2 Apr 2020 16:43:57 +0300 From: Andrey Repin X-Mailer: The Bat! (v6.8.8) Home X-Priority: 3 (Normal) Message-ID: <117150818.20200402164357@yandex.ru> To: L A Walsh , cygwin AT cygwin DOT 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 In-Reply-To: <5E85899A.9090408@tlinx.org> References: <5E85899A DOT 9090408 AT tlinx DOT org> MIME-Version: 1.0 X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_2, KAM_THEBAT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces AT cygwin DOT com Sender: "Cygwin" 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... -- 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