From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by sourceware.org (Postfix) with ESMTPS id 1B612388A016 for ; Thu, 2 Apr 2020 13:50:04 +0000 (GMT) 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@yandex.ru Received: from forward101q.mail.yandex.net (forward101q.mail.yandex.net [IPv6:2a02:6b8:c0e:4b:0:640:4012:bb98]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 500C011A0BDB; Thu, 2 Apr 2020 16:50:02 +0300 (MSK) Received: from mxback8q.mail.yandex.net (mxback8q.mail.yandex.net [IPv6:2a02:6b8:c0e:42:0:640:b38f:32ec]) by forward101q.mail.yandex.net (Yandex) with ESMTP id 498D9CF4000C; Thu, 2 Apr 2020 16:50:02 +0300 (MSK) Received: from vla3-5ed9a7202853.qloud-c.yandex.net (vla3-5ed9a7202853.qloud-c.yandex.net [2a02:6b8:c15:341d:0:640:5ed9:a720]) by mxback8q.mail.yandex.net (mxback/Yandex) with ESMTP id Qr2mPWR64a-o2t8beWH; Thu, 02 Apr 2020 16:50:02 +0300 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 Received: by vla3-5ed9a7202853.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 0ie0eaAMrC-o13apYhN; Thu, 02 Apr 2020 16:50:01 +0300 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client certificate not present) Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Thu, 02 Apr 2020 13:43:57 -0000 Date: Thu, 2 Apr 2020 16:43:57 +0300 From: Andrey Repin X-Mailer: The Bat! (v6.8.8) Home Reply-To: cygwin@cygwin.com X-Priority: 3 (Normal) Message-ID: <117150818.20200402164357@yandex.ru> To: L A Walsh , 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 In-Reply-To: <5E85899A.9090408@tlinx.org> References: <5E85899A.9090408@tlinx.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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@cygwin.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: , X-List-Received-Date: Thu, 02 Apr 2020 13:50:06 -0000 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...