Re: --line-regexp option with null data

2015-07-17 Thread Eric Blake
On 07/16/2015 08:04 PM, John Hein wrote: > > printf 'alpha\0bravo\0charlie\0' | grep --line-regexp --quiet bravo > > > > My thinking tells me that because I have not used `--null-data`, grep > should see > > 1 or even 0 lines separated by newline, and fail to match a `bravo` > followed b

Re: --line-regexp option with null data

2015-07-16 Thread Steven Penny
On Thu, Jul 16, 2015 at 9:04 PM, John Hein wrote: > 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. It appears to be intended behavior starting with version 2.21: > If a file conta

Re: --line-regexp option with null data

2015-07-16 Thread Vince Rice
> On Jul 16, 2015, at 10:04 PM, Steven Penny wrote: > > On Thu, Jul 16, 2015 at 9:30 PM, Andrey Repin wrote: >> Linux grep will do the same. >> null byte = not a text. >> Wrong encoding, not matching locale = not a text. > > I have repeatedly asked you to stay out of my threads. My experience is

Re: --line-regexp option with null data

2015-07-16 Thread Steven Penny
On Thu, Jul 16, 2015 at 9:30 PM, Andrey Repin wrote: > Linux grep will do the same. > null byte = not a text. > Wrong encoding, not matching locale = not a text. I have repeatedly asked you to stay out of my threads. My experience is you typically misread, misunderstand or misrepresent most or all

Re: --line-regexp option with null data

2015-07-16 Thread Andrey Repin
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 b

Re: --line-regexp option with null data

2015-07-16 Thread John Hein
Steven Penny svnpenn-at-gmail.com |cygwin_ml_nodigest| wrote at 20:29 -0500 on Jul 16, 2015: > Consider this command: > > printf 'alpha\nbravo\ncharlie\n' | grep --line-regexp --quiet bravo > > grep sees 3 lines separated by newline, and matches the bravo line. Now > consider > this co