diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2014-12-15 23:09:27 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2014-12-15 23:10:04 -0800 |
commit | 4aed929ac46fae52b47990190d3ffa16fae233b0 (patch) | |
tree | 6db13611a9af16cd3baae938e152d8a28d8ef5af /doc/grep.texi | |
parent | 0c5f86f38ea20887cfec0c914b06ff92551b042e (diff) | |
download | grep-4aed929ac46fae52b47990190d3ffa16fae233b0.tar.gz |
doc: document binary-data heuristic better
Problem reported by Martin Hoch in: http://bugs.gnu.org/19388
* doc/grep.texi (File and Directory Selection):
Document what non-text bytes are.
(Usage): Fix cross reference.
Diffstat (limited to 'doc/grep.texi')
-rw-r--r-- | doc/grep.texi | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/doc/grep.texi b/doc/grep.texi index 63016bdc..acd5be8d 100644 --- a/doc/grep.texi +++ b/doc/grep.texi @@ -596,6 +596,11 @@ If a file's allocation metadata, or if its data read before a line is selected for output, indicate that the file contains binary data, assume that the file is of type @var{type}. +Non-text bytes indicate binary data; these are either data bytes +improperly encoded for the current locale, or null bytes when the +@option{-z} (@option{--null-data}) option is not given (@pxref{Other +Options}). + By default, @var{type} is @samp{binary}, and @command{grep} normally outputs either a one-line message saying that a binary file matches, @@ -1721,8 +1726,8 @@ Standard grep cannot do this, as it is fundamentally line-based. Therefore, merely using the @code{[:space:]} character class does not match newlines in the way you might expect. -With the GNU @command{grep} option @code{-z} (@pxref{File and -Directory Selection}), the input is terminated by null bytes. Thus, +With the GNU @command{grep} option @option{-z} (@option{--null-data}), each +input ``line'' is terminated by a null byte; @pxref{Other Options}. Thus, you can match newlines in the input, but typically if there is a match the entire input is output, so this usage is often combined with output-suppressing options like @option{-q}, e.g.: |