[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tr portability
From: |
Eric Blake |
Subject: |
Re: tr portability |
Date: |
Sat, 26 Apr 2008 06:47:25 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[dropping bug-* lists]
According to Eric Blake on 4/26/2008 6:35 AM:
| | 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
| |
I noticed Bruno went one step further in gnulib:
+# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
+# does not understand '\r'.
+if echo solaris | tr -d '\r' | grep solais > /dev/null; then
+ cr='\015'
+else
+ cr='\r'
+fi
+
~ # normalize output
- -LC_ALL=C tr -d '\r' < t-xstrtoimax.tmp > t-xstrtoimax.xo
+LC_ALL=C tr -d "$cr" < t-xstrtoimax.tmp > t-xstrtoimax.xo
Is this workaround worth documenting, as a way to avoid the ASCII
dependency on \015?
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----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
iEYEARECAAYFAkgTJF0ACgkQ84KuGfSFAYCYWgCfUnXoTMOyEbdfXVfSX5fv7xIe
RQMAn3lFc3lU+L4IcvwNqajvnqDeo/8I
=BcK5
-----END PGP SIGNATURE-----