public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Soegtrop, Michael" <michael.soegtrop@intel.com>
To: "Ondrej Surý" <ondrej@isc.org>
Cc: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: RE: grep 3.0-2 not stripping CRs on Windows
Date: Mon, 17 Dec 2018 12:51:00 -0000	[thread overview]
Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A178FCF7CFC@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <35FC3865-8891-4058-86DF-DA5F1DEFAFD4@isc.org>

Dear Ondrej,

> # Use —text —> finds the text OK

Afaik -a / --text only suppresses this behavior (from man grep):

             ... when grep discovers that a file is binary  it  suppresses  any  further
              output,  and instead outputs either a one-line message saying that a binary file matches, or no message
              if there is no match.

It does not influence if the file is opened as text or binary file. I agree that the documentation to -U in man grep explicitly says that if a file is a text file, CRs are stripped, so that is a documentation bug. This should be updated (as Corinna already suggested).

I still think that it would also make sense to:

- have for grep, sed and awk at least an option to strip CRs
- have an environment variable to make this option default

But otherwise I must admit that handling scripts intended for Unix works very well with Cygwin so the decision made appear to be good decisions, even if they are sometimes not what one wants.

Best regards,

Michael

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

--
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:[~2018-12-17 12:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17 11:55 Ondřej Surý
2018-12-17 12:04 ` Soegtrop, Michael
2018-12-17 12:22   ` Ondřej Surý
2018-12-17 12:51     ` Soegtrop, Michael [this message]
2018-12-17 13:05     ` Steven Penny
2018-12-17 15:38       ` cyg Simple
2018-12-17 12:09 ` Corinna Vinschen
  -- strict thread matches above, loose matches on Subject: below --
2018-12-17 11:10 Ondřej Surý
2018-12-17 11:41 ` Marco Atzeri
2018-12-17 23:37 ` Andrey Repin

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=0F7D3B1B3C4B894D824F5B822E3E5A178FCF7CFC@IRSMSX102.ger.corp.intel.com \
    --to=michael.soegtrop@intel.com \
    --cc=cygwin@cygwin.com \
    --cc=ondrej@isc.org \
    /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).