X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org From: Adam Dinwoodie To: "cygwin AT cygwin DOT com" Subject: RE: Is this a bug or a behavior? Date: Wed, 13 Feb 2013 16:55:01 +0000 Deferred-Delivery: Wed, 13 Feb 2013 16:55:00 +0000 Message-ID: References: <511BBBD4 DOT 8090902 AT fastmail DOT fm> In-Reply-To: <511BBBD4.8090902@fastmail.fm> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id r1DGtQsX001874 Jack Radigan wrote: > Using the following script: > #!/bin/bash > set -x > cat << eof | `ls /bin | grep "^grep$"` alpha > alpha > omega > eof Easier repro showing this phenomena: ls /bin | grep '^grep$' On Linux, you'll get "grep" as output. Cygwin won't output anything. > But, the command 'cp /bin/grep ~/.' will copy grep.exe to my home directory. Yes. If you ask for a file, the file doesn't exist, but the file with a .exe extension exists, Cygwin will refer you to the .exe version of the file. See . > Shouldn't 'ls' be suppressing the '.exe' extension for cygwin binaries > in the same way that 'cp' appends it? No: ls tells you about what files actually exist. "grep.exe" exists; "grep" doesn't. > Seems inconsistent not to. From that point of view it is; Cygwin is self-consistent, but the very nature of attempting to write a Linux-like interface on a fundamentally non-Linux like OS means such issues can't be avoided. Nobody has yet suggested a more consistent alternative that still allows, for example, a Linux shell script that calls unadorned "grep" to work on Cygwin. If this is causing you a real problem that you can explain, the list may be able to give you some assistance working around it. For your (I really hope) contrived example, replace the command substitution with "/bin/grep" for a script that will work on both Linux and Cygwin. -- Adam Dinwoodie Messages posted to this list are made in a personal capacity. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple