From: Bruno Haible Date: Tue, 18 Aug 2009 20:17:51 +0000 (+0200) Subject: Document Solaris tr range and NUL limitations. X-Git-Tag: v2.65~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d50a0ed98d3789015d63fc127d8a95af65cf8e8;p=thirdparty%2Fautoconf.git Document Solaris tr range and NUL limitations. * doc/autoconf.texi (Limitations of Usual Tools): Mention that Solaris /usr/bin/tr does not support ranges, nor the '\0' octal escape. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index 0c317234c..1242ca646 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-18 Bruno Haible + + Document Solaris tr range and NUL limitations. + * doc/autoconf.texi (Limitations of Usual Tools): Mention that + Solaris /usr/bin/tr does not support ranges, nor the '\0' octal + escape. + 2009-08-14 Eric Blake Simplify version control metadata. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 6bac0c3a3..e99796207 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -17802,11 +17802,23 @@ $ @kbd{@{ echo moon; echo light; @} | /usr/ucb/tr -d '\012' ; echo} moonlight @end example +Not all versions of @command{tr} recognize ranges of characters: at +least Solaris @command{/usr/bin/tr} still fails to do so. But you can +use @command{/usr/xpg4/bin/tr} instead. + +@example +$ @kbd{echo "Hazy Fantazy" | LC_ALL=C /usr/bin/tr a-z A-Z} +HAZy FAntAZy +$ @kbd{echo "Hazy Fantazy" | LC_ALL=C /usr/xpg4/bin/tr a-z A-Z} +HAZY FANTAZY +@end example + Posix requires @command{tr} to operate on binary files. But at least -Solaris @command{/usr/ucb/tr} still fails to handle @samp{\0} as the -octal escape for @code{NUL}. On Solaris, when using @command{tr} to -neutralize a binary file by converting @code{NUL} to a different -character, it is necessary to use @command{/usr/xpg4/bin/tr} instead. +Solaris @command{/usr/ucb/tr} and @command{/usr/bin/tr} still fail to +handle @samp{\0} as the octal escape for @code{NUL}. On Solaris, when +using @command{tr} to neutralize a binary file by converting @code{NUL} +to a different character, it is necessary to use +@command{/usr/xpg4/bin/tr} instead. @example $ @kbd{printf 'a\0b\n' | /usr/ucb/tr '\0' '~' | wc -c}