[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

update doc about Solaris 'tr'

From: Bruno Haible
Subject: update doc about Solaris 'tr'
Date: Sun, 16 Aug 2009 22:25:42 +0200
User-agent: KMail/1.9.9


On a Solaris 10 machine, I happened to not have /usr/xpg4/bin in front of
/usr/bin in my PATH. Consequence: The 'tr' program does not recognize
the POSIX (and BSD) syntax for character ranges. The autoconf doc should
mention this, IMO. Here's a proposed patch. While at it, let's also
mention that /usr/bin/tr still has the '\0' bug. (I verified it.)

2009-08-16  Bruno Haible  <address@hidden>

        * doc/autoconf.texi (Limitations of Usual Tools): Mention that Solaris
        /usr/bin/tr does not support ranges, nor the '\0' octal escape.

--- doc/autoconf.texi.orig      2009-08-16 22:19:26.000000000 +0200
+++ doc/autoconf.texi   2009-08-16 22:16:20.000000000 +0200
@@ -17802,11 +17802,23 @@
 @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.
+$ @kbd{echo "Hazy Fantazy" | LC_ALL=C /usr/bin/tr a-z A-Z}
+$ @kbd{echo "Hazy Fantazy" | LC_ALL=C /usr/xpg4/bin/tr a-z A-Z}
address@hidden 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
address@hidden/usr/xpg4/bin/tr} instead.
 $ @kbd{printf 'a\0b\n' | /usr/ucb/tr '\0' '~' | wc -c}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]