]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (Limitations of Usual Tools) <grep>: Document
authorEric Blake <ebb9@byu.net>
Thu, 24 Jan 2008 03:24:47 +0000 (20:24 -0700)
committerEric Blake <ebb9@byu.net>
Tue, 29 Jan 2008 02:14:27 +0000 (19:14 -0700)
BSD behavior on binary input.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/autoconf.texi

index b8e7fb0dc825f40e9abbd73fb494755ba6ed2081..a3f52fe181611cbc77fcf193dafdd196432b4844 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2008-01-28  Eric Blake  <ebb9@byu.net>
 
+       Document grep peculiarity.
+       * doc/autoconf.texi (Limitations of Usual Tools) <grep>: Document
+       BSD behavior on binary input.
+
        Minor testsuite improvements.
        * lib/autotest/general.m4 (AT_INIT) <PREPARE_TESTS>: Use fewer
        forks when sanitizing PATH.  Always output machine information,
index 59e6f97e8c76344b90680c98fadf7788bdedc1d1..f6421d7a28f674dee640811197536c62ec71900b 100644 (file)
@@ -14957,6 +14957,20 @@ Similarly, the following escape sequences should also be avoided:
 @samp{\<}, @samp{\>}, @samp{\+}, @samp{\?}, @samp{\`}, @samp{\'},
 @samp{\B}, @samp{\b}, @samp{\S}, @samp{\s}, @samp{\W}, and @samp{\w}.
 
+Posix does not specify the behavior of @command{grep} on binary files.
+An example where this matters is using @acronym{BSD} @command{grep} to
+search text that includes embedded @acronym{ANSI} escape sequences for
+colored output to terminals (@samp{\033[m} is the sequence to restore
+normal output); the behavior depends on whether input is seekable:
+
+@example
+$ @kbd{printf 'esc\033[mape\n' > sample}
+$ @kbd{grep . sample}
+Binary file sample matches
+$ @kbd{cat file | grep .}
+escape
+@end example
+
 
 @item @command{join}
 @c -----------------