]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Clarify octal escapes with tr.
authorEric Blake <eblake@redhat.com>
Mon, 26 Apr 2010 15:30:06 +0000 (09:30 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 26 Apr 2010 15:35:18 +0000 (09:35 -0600)
* doc/autoconf.texi (Limitations of Usual Tools): Carriage return
is portable in octal, but not newline.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
doc/autoconf.texi

index d301e6bddfb5b63a11ab25a280642aa17dda0025..85d2b11adededffd357929981f264d29976b683d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-26  Eric Blake  <eblake@redhat.com>
+
+       Clarify octal escapes with tr.
+       * doc/autoconf.texi (Limitations of Usual Tools): Carriage return
+       is portable in octal, but not newline.
+
 2010-04-22  Joel James Adamson  <joel@chondestes.bio.unc.edu>  (tiny change)
 
        Add a paragraph to FAQ on Debugging configure scripts.
index 1ffaeab416e3f36f4dc1fee204b96c2d8f25c8ea..fa6015f604113cb253fd76b678559ab372d11e4c 100644 (file)
@@ -18393,13 +18393,16 @@ However, these problems are no longer of practical concern.
 @c ---------------
 @prindex @command{tr}
 @cindex carriage return, deleting
+@cindex newline, deleting
 @cindex 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 ASCII, when using @command{tr} to delete
-newlines or carriage returns.
+Using octal escapes is more portable for carriage returns, since
+@samp{\015} is the same for both ASCII and EBCDIC, and since use of
+literal carriage returns in scripts causes a number of other problems.
+But for other characters, like newline, using octal escapes ties the
+operation to ASCII, so it is better to use literal characters.
 
 @example
 $ @kbd{@{ echo moon; echo light; @} | /usr/ucb/tr -d '\n' ; echo}
@@ -18409,6 +18412,9 @@ $ @kbd{@{ echo moon; echo light; @} | /usr/bin/tr -d '\n' ; echo}
 moonlight
 $ @kbd{@{ echo moon; echo light; @} | /usr/ucb/tr -d '\012' ; echo}
 moonlight
+$ @kbd{nl='}
+@kbd{'; @{ echo moon; echo light; @} | /usr/ucb/tr -d "$nl" ; echo}
+moonlight
 @end example
 
 Not all versions of @command{tr} recognize ranges of characters: at