From: Łukasz S. <luk...@ie...> - 2010-04-04 00:01:42
|
Earnie <ea...@us...> writes: > Łukasz Stelmach wrote: >> Hello. >> >> grep from MSYS includes CR as a part of pattern read from a file with a >> -f option. This seems to be rather obvious bug, doesn't it? Is there any >> magic trick to overcome it? >> > > cat foo | tr -d "\r" > bar && mv bar foo > > If the file contains CR then that is a character in the file and MSYS > provides a pseudo UNIX environment which reads the CR as a character. > CRLF line endings and MSYS do not mix well. Never has and MSYS has been > around for more years than I remember. Thanks. I was sure I've read somewhere that mingw C runtime/libc (I am not very familiar with these bits under Windows) supports the "\n" <-> "\r\n" conversion automatically. That's why grep's behaviour seemed odd to me. But if that is just the way things work it's OK. -- Miłego dnia, Łukasz Stelmach |