From: Thomas Wolff <towo@towo.net>
To: cygwin@cygwin.com
Subject: Re: --text option of grep v3.7-2 not working
Date: Wed, 16 Nov 2022 17:53:09 +0100 [thread overview]
Message-ID: <965e2dff-f624-21f5-90b7-62fb9fbbc6a2@towo.net> (raw)
In-Reply-To: <20221116125047.xmrb6zmkmepoxbiv@math.berkeley.edu>
Am 16/11/2022 um 13:50 schrieb Ilya Zakharevich:
> grep with -a (or --text) option does not strip CR from line ends
>
> Broken in: CYGWIN_NT-6.1 Bu 3.3.4(0.341/5/3) 2022-01-31 19:35 x86_64 Cygwin
> grep (GNU grep) 2.21
>
> Works in: CYGWIN_NT-6.1-WOW Bu 2.2.1(0.289/5/3) 2015-08-20 11:40 i686 Cygwin
> grep (GNU grep) 3.7
> Packaged by Cygwin (3.7-2)
>
> To reproduce, do in CMD’s command line:
>
> D:\> D:\Programs\cygwin2022\bin\perl -we "print qq(abc\r\n)" | D:\Programs\cygwin2022\bin\grep -a "abc$"
>
> This does not emit anything (contrary to the man page, which says:
>
> If grep decides the file is a text file, it strips the CR
> characters from the original file contents (to make regular
> expressions with ^ and $ work correctly).
This section in the manpage is preceded by
By default, under MS-DOS and MS-Windows, grep guesses whether
a file is text or binary as described for the --binary-files option.
which may be interpreted so that this stripping only occurs in the
DOS/Windows versions, which the cygwin version isn't.
If you think this is unclear, as the Linux version behaves the same way,
you should report this upstream.
>
> (The same happens on Win10.)
>
> Hope this helps,
> Ilya
>
> P.S. It seems that the mailing list does not allow attaching the output!
> So I retry with a shortened version…
>
next prev parent reply other threads:[~2022-11-16 16:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-16 12:50 Ilya Zakharevich
2022-11-16 16:53 ` Thomas Wolff [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-11-15 6:22 Ilya Zakharevich
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=965e2dff-f624-21f5-90b7-62fb9fbbc6a2@towo.net \
--to=towo@towo.net \
--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).