This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: --line-regexp option with null data
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: "John Hein" <3fbmqnhaz4 at snkmail dot com>, cygwin at cygwin dot com
- Date: Fri, 17 Jul 2015 05:30:47 +0300
- Subject: Re: --line-regexp option with null data
- Authentication-results: sourceware.org; auth=none
- References: <CAAXzdLWo4nvaJBMOBYsOYeCdrgw_O=8CM_H_kwfxnU=AqnuOjA at mail dot gmail dot com> <6138-1437098652-808922 at sneakemail dot com>
- Reply-to: cygwin at cygwin dot com
Greetings, John Hein!
> cygwin grep is detecting the input as binary which seems to be
> overriding the 'match the whole line' behavior of --line-regexp. Get
> rid of --quiet to see that.
> That does seem like a bug in the cygwin implementation of grep to me.
Linux grep will do the same.
null byte = not a text.
Wrong encoding, not matching locale = not a text.
This is an upstream decision. It is arguable consistent… on Linux.
On Windows, of course, this is not the case.
> As a workaround for this simple example, you can add -a (aka --text)
> to force it to treat the input as text.
--
With best regards,
Andrey Repin
Friday, July 17, 2015 05:29:11
Sorry for my terrible english...