-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bruno Haible on 4/26/2008 6:06 AM:
| Ralf Wildenhues wrote:
|>>> I hear that there really do exist systems in actual use
|>>> on which tr still does not honor backslash-escapes like \r and \n.
|>> Which platforms, please?
|> Solaris 10 /usr/ucb/tr.  Not likely to be early in PATH, but hey, people
|> do all kinds of weird things to their path.  ;-)
|
| This is not documented in the autoconf manual, section "Limitations of
| Usual Tools". But I can confirm the fact:
|
| $ { echo moon; echo light; } | /usr/ucb/tr -d '\n' ; echo
| moo
| light
|
| $ { echo moon; echo light; } | /usr/bin/tr -d '\n' ; echo
| moonlight
| $ { echo moon; echo light; } | /usr/ucb/tr -d '\012' ; echo
| moonlight

Thanks.  I've committed this:

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgTIX8ACgkQ84KuGfSFAYBB+gCfYd72JUZ1KLzv8b1r2EK/Qjho
F0cAn0RxWzJxGTUVZ7fY5znL9NtyziI7
=FP9E
-----END PGP SIGNATURE-----
>From c242f622dcbd6a9c467fe9213254d7ffac3535f3 Mon Sep 17 00:00:00 2001
From: Eric Blake <[EMAIL PROTECTED]>
Date: Sat, 26 Apr 2008 06:32:19 -0600
Subject: [PATCH] Mention Solaris /usr/ucb/tr pitfall.

* doc/autoconf.texi (Limitations of Usual Tools) <tr>: Add section.
Reported by Bruno Haible and Jim Meyering.

Signed-off-by: Eric Blake <[EMAIL PROTECTED]>
---
 ChangeLog         |    6 ++++++
 doc/autoconf.texi |   22 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fad30e7..705e71e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-26  Eric Blake  <[EMAIL PROTECTED]>
+
+       Mention Solaris /usr/ucb/tr pitfall.
+       * doc/autoconf.texi (Limitations of Usual Tools) <tr>: Add section.
+       Reported by Bruno Haible and Jim Meyering.
+
 2008-04-24  Eric Blake  <[EMAIL PROTECTED]>
 
        Mention m4sugar's internal quote strings.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index ff7ffc7..a5e880a 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -15607,6 +15607,28 @@ fails to work on SunOS 4.1.3 when the empty file is on 
an
 @acronym{NFS}-mounted 4.2 volume.
 However, these problems are no longer of practical concern.
 
[EMAIL PROTECTED] @command{tr}
[EMAIL PROTECTED] ---------------
[EMAIL PROTECTED] @command{tr}
[EMAIL PROTECTED] carriage return, deleting
[EMAIL PROTECTED] deleting carriage return
+Not all versions of @command{tr} handle all backslash character escapes.
+For example, Solaris 10 @command{/usr/ucb/tr} falls over, even though
+Solaris contains more modern @command{tr} in other locations.
+Therefore, it is more portable to use octal escapes, even though this
+ties the result to @acronym{ASCII}, when using @command{tr} to delete
+newlines or carriage returns.
+
[EMAIL PROTECTED]
+$ @[EMAIL PROTECTED] echo moon; echo light; @} | /usr/ucb/tr -d '\n' ; echo}
+moo
+light
+$ @[EMAIL PROTECTED] echo moon; echo light; @} | /usr/bin/tr -d '\n' ; echo}
+moonlight
+$ @[EMAIL PROTECTED] echo moon; echo light; @} | /usr/ucb/tr -d '\012' ; echo}
+moonlight
[EMAIL PROTECTED] example
+
 @end table
 
 
-- 
1.5.5.1

Reply via email to