delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/02/15/23:25:19

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:to:subject:references
:content-type; q=dns; s=default; b=S6ZmByNBNHGw6disIwUBz4N4O7C2y
jKi06+vvbOEKgu+fpEbQpBRnDykjaXwwGkfAAU4Aj9LNj+3M1DhFvkU1L18USYpy
DbWBfV5UCS9Y+YsvYsm77c7tOcI49R5WmnXGaqwsdH648YSpM/tRpHerNssGbW9u
e6wU9iIOW1FXMw=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:to:subject:references
:content-type; s=default; bh=6UtchSmwKoI+FJyyM/4FMvryhR4=; b=FvV
pn+BYi1d/CzfkJN1vVh6vp3cYVh2o1eq5eBZXDUPj33KV8sOa5UpuFjafhVgHIvy
L8BPS3noMqR2etDCqHLsfyaSsOgVv0K96Z8BLKCTEEjFL+3BFFOFCV1w4WOpYhUK
TLna0QW1LTRcxh30joanjfLMWB9lDW8MjtecPPgM=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:789, H*r:6000, H*M:google, H*UA:github.com
X-HELO: mail-oi0-f48.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:to:subject:references :user-agent; bh=vPU6/Q45Fwn8S9xg1yxnBe6+F5+TAYQ8s5dJmSEl9ZQ=; b=Us3oKu0POi4Ai8cdPp5d5cr8wb2nNTOpmiJSTvH1U3JqE204SZBV+P7YjQoS5cHFZw 1u4hXEfSxYqbkKXEaJbwHJ+XwuoDp3V8C4fNxY4ussdVv3HZy/Z/+ZDwl/9pLxzIhGTz fpEhvsuEZVvaRBE3HJ7ZciWKirb65QOJIpOnLuqwtoBB0JsFmDg0qGLWBFm3xcn83QUH grYQ9TgFmyM8iUqLUbmHPknyvSBs7GKdBeXv+46WGtld41RZfWNV2vr/pisvQvR1LkZ1 0q/ZI0cVAqB3uuWi0fjluy/yjej69LgaGdr/TjnWMzf/IEO37ccGUqtnAUEoB/0x6Vtv ehyw==
X-Gm-Message-State: AMke39mLu4CXQh5nJGISMY04CGtNt5dvm6t6SuOsCHL1joLAWplOwnfTgIVaLQD5+VdLcA==
X-Received: by 10.202.90.135 with SMTP id o129mr129790oib.69.1487219101961; Wed, 15 Feb 2017 20:25:01 -0800 (PST)
Message-ID: <58a5299d.26149d0a.a2c17.d033@mx.google.com>
Date: Wed, 15 Feb 2017 20:25:01 -0800 (PST)
From: Steven Penny <svnpenn AT gmail DOT com>
X-Google-Original-From: Steven Penny
To: cygwin AT cygwin DOT com
Subject: Re: [ANNOUNCEMENT] Updated [test]: grep-3.0-2
References: <announce DOT 1ee39b81-925c-cb2e-efe5-bd06f27a8440 AT redhat DOT com>
User-Agent: Tryst/2.0.1 (github.com/svnpenn/tryst)

On Tue, 14 Feb 2017 10:17:25, "Eric Blake (cygwin)" wrote:
> This build modifies the behavior of grep to no longer force text mode on
> binary-mounted file descriptors.

Works, thanks:

    $ printf 'hello world\r\n' | grep . | od -tcx1
    0000000   h   e   l   l   o       w   o   r   l   d  \r  \n
             68  65  6c  6c  6f  20  77  6f  72  6c  64  0d  0a

> Since this includes pipelines by default, this means that if you pipe text
> data through a pipeline (such as the output of a windows program), you may
> need to insert a call to d2u to sanitize your input before passing it to grep.

This is certainly a good way to do it, but for more portable solution use tr:

    $ printf 'hello world\r\n' | tr -d '\r' | od -tcx1
    0000000   h   e   l   l   o       w   o   r   l   d  \n
             68  65  6c  6c  6f  20  77  6f  72  6c  64  0a


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