public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Steven Penny <svnpenn@gmail.com>
To: cygwin@cygwin.com
Subject: Re: [ANNOUNCEMENT] Updated [test]: grep-3.0-2
Date: Thu, 16 Feb 2017 04:25:00 -0000	[thread overview]
Message-ID: <58a5299d.26149d0a.a2c17.d033@mx.google.com> (raw)
In-Reply-To: <announce.1ee39b81-925c-cb2e-efe5-bd06f27a8440@redhat.com>

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

  reply	other threads:[~2017-02-16  4:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 16:20 Eric Blake (cygwin)
2017-02-16  4:25 ` Steven Penny [this message]
2017-02-16  6:17   ` Brian Inglis
2017-02-17 16:43   ` cyg Simple
2017-02-17 23:42     ` Steven Penny
2017-02-18 13:00       ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58a5299d.26149d0a.a2c17.d033@mx.google.com \
    --to=svnpenn@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).