]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Improve documentation on Solaris tr bugs.
authorBruno Haible <bruno@clisp.org>
Thu, 31 Dec 2009 13:50:44 +0000 (06:50 -0700)
committerEric Blake <ebb9@byu.net>
Thu, 31 Dec 2009 13:50:44 +0000 (06:50 -0700)
* doc/autoconf.texi (Limitations of Usual Tools) <tr>: Refine
description of NUL handling by Solaris tr.

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

index b0a4474aa10ef3b11f287eed029b8af69278d3f1..01439892a4dbae6821a8b5946ebdd226b345cf14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-12-31  Bruno Haible  <bruno@clisp.org>
+
+       Improve documentation on Solaris tr bugs.
+       * doc/autoconf.texi (Limitations of Usual Tools) <tr>: Refine
+       description of NUL handling by Solaris tr.
+
 2009-12-31  Eric Blake  <ebb9@byu.net>
 
        Another tr tweak.
index 6e1356e30a3324bb6cd0dfe4699f5ed086d41613..df4c58451183a602fe4dab621845a12f7d4388d6 100644 (file)
@@ -18347,20 +18347,31 @@ add
 @end example
 
 Posix requires @command{tr} to operate on binary files.  But at least
-Solaris @command{/usr/ucb/tr} fails to handle @samp{\0} as the octal
-escape for @code{NUL}, and Solaris @command{/usr/bin/tr} silently
-discards @code{NUL} in the input prior to doing any translation.  When
-using @command{tr} to process a binary file that may contain @code{NUL}
-bytes, it is necessary to use @command{/usr/xpg4/bin/tr} instead, or
+Solaris @command{/usr/ucb/tr} and @command{/usr/bin/tr} silently discard
+@code{NUL} in the input prior to doing any translation.  When using
+@command{tr} to process a binary file that may contain @code{NUL} bytes,
+it is necessary to use @command{/usr/xpg4/bin/tr} instead, or
 @command{/usr/xpg6/bin/tr} if that is available.
 
 @example
-$ @kbd{printf 'ab\0c' | /usr/ucb/tr 'a\0' '\0d' | od -An -tx1}
+$ @kbd{printf 'a\0b' | /usr/ucb/tr x x | od -An -tx1}
+ 61 62
+$ @kbd{printf 'a\0b' | /usr/bin/tr x x | od -An -tx1}
+ 61 62
+$ @kbd{printf 'a\0b' | /usr/xpg4/bin/tr x x | od -An -tx1}
+ 61 00 62
+@end example
+
+Solaris @command{/usr/ucb/tr} additionally fails to handle @samp{\0} as the
+octal escape for @code{NUL}.
+
+@example
+$ @kbd{printf 'abc' | /usr/ucb/tr 'bc' '\0d' | od -An -tx1}
  61 62 63
-$ @kbd{printf 'ab\0c' | /usr/bin/tr 'a\0' '\0d' | od -An -tx1}
- 00 62 63
-$ @kbd{printf 'ab\0c' | /usr/xpg4/bin/tr 'a\0' '\0d' | od -An -tx1}
- 00 62 64 63
+$ @kbd{printf 'abc' | /usr/bin/tr 'bc' '\0d' | od -An -tx1}
+ 61 00 64
+$ @kbd{printf 'abc' | /usr/xpg4/bin/tr 'bc' '\0d' | od -An -tx1}
+ 61 00 64
 @end example
 
 @end table