public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* --line-regexp option with null data
@ 2015-07-17  1:29 Steven Penny
  2015-07-17  2:04 ` John Hein
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Penny @ 2015-07-17  1:29 UTC (permalink / raw)
  To: cygwin

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

    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 by
newline. However it does not, it succeeds just like the first command, why is
this?

Note I also tried this on Debian with Grep 2.2 and it works as expected.

http://stackoverflow.com/q/31467045

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-07-17 11:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-17  1:29 --line-regexp option with null data Steven Penny
2015-07-17  2:04 ` John Hein
2015-07-17  2:35   ` Andrey Repin
2015-07-17  3:04     ` Steven Penny
2015-07-17  3:26       ` Vince Rice
2015-07-17  3:44   ` Steven Penny
2015-07-17 11:55   ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).