grep 3.0-2 not stripping CRs on Windows

Ondřej Surý ondrej@isc.org
Mon Dec 17 11:55:00 GMT 2018


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

Ondrej
--
Ondřej Surý
ondrej@isc.org


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



More information about the Cygwin mailing list