Web lists-archives.com

Re: grep 3.0-2 not stripping CRs on Windows




On Dec 17 12:55, Ondřej Surý wrote:
> [Sorry, I am not subscribed, so I can’t add proper References: headers here.]
> 
> > Cygwin is a POSIX platform not a pure Windows one.
> > If you need to strip CR character, d2u of dos2unix package is the  tool.
> 
> I am not claiming that Cygwin is a pure Windows platform, but having to run everything through d2u (or tr -d ‘\r’) hardly makes cygwin usable to write platform agnostic scripts, right?
> 
> It is a regression from 2.27-2 version of the package:
> 
> $ grep --version
> grep (GNU grep) 2.27
> Packaged by Cygwin (2.27-2)
> Copyright (C) 2016 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
> $ echo -e 'foo\r\n' | grep -a 'foo$'
> foo
> $
> 
> And it also it contradicts from the documentation (manpage) bundled with the version.
> 
> I think it’s reasonable to classify this as a bug.

This was a deliberate change back in February 2017:

  https://cygwin.com/ml/cygwin-announce/2017-02/msg00035.html
  https://cygwin.com/ml/cygwin-announce/2017-02/msg00036.html
  https://cygwin.com/ml/cygwin-announce/2017-02/msg00034.html

A documentation change might make sense, though.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

Attachment: signature.asc
Description: PGP signature