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). (The same happens on Win10.) Hope this helps, Ilya