delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/02/13/12:44:29

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
X-Mail-Handler: Dyn Standard SMTP by Dyn
X-Report-Abuse-To: abuse AT dyndns DOT com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information)
X-MHO-User: U2FsdGVkX19IDkQbwYxec1WMs76PNHtX
Date: Wed, 13 Feb 2013 12:44:11 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Is this a bug or a behavior?
Message-ID: <20130213174411.GA4176@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <511BBBD4 DOT 8090902 AT fastmail DOT fm> <CE9C056E12502146A72FD81290379E9A608E7C64 AT ENFIRHMBX1 DOT datcon DOT co DOT uk>
MIME-Version: 1.0
In-Reply-To: <CE9C056E12502146A72FD81290379E9A608E7C64@ENFIRHMBX1.datcon.co.uk>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Wed, Feb 13, 2013 at 04:55:01PM +0000, Adam Dinwoodie wrote:
>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.

Yep, but if you want to write code that will work on both *nix and
Cygwin you could do this:

ls /bin | sed -n -e 's/\.exe$//' -e '/grep/p'

That works on both Cygwin and Linux.

cgf

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019