From: Eric Blake Date: Thu, 24 Jan 2008 03:24:47 +0000 (-0700) Subject: * doc/autoconf.texi (Limitations of Usual Tools) : Document X-Git-Tag: v2.62~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0d6f350fee9d91382295e89d7cc50dc2a2cfadc;p=thirdparty%2Fautoconf.git * doc/autoconf.texi (Limitations of Usual Tools) : Document BSD behavior on binary input. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index b8e7fb0d..a3f52fe1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-01-28 Eric Blake + Document grep peculiarity. + * doc/autoconf.texi (Limitations of Usual Tools) : Document + BSD behavior on binary input. + Minor testsuite improvements. * lib/autotest/general.m4 (AT_INIT) : Use fewer forks when sanitizing PATH. Always output machine information, diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 59e6f97e..f6421d7a 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -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 -----------------