This is the mail archive of the
mailing list for the Cygwin project.
Re: tr command suddenly behaves differently
- From: Eric Blake <ebb9 at byu dot net>
- To: cygwin at cygwin dot com, jim at cs dot ualberta dot ca
- Date: Sun, 24 Sep 2006 07:38:19 -0600
- Subject: Re: tr command suddenly behaves differently
- References: <S557806AbWIXHCX/20060924070231Zfirstname.lastname@example.org>
-----BEGIN PGP SIGNED MESSAGE-----
According to Jim Easton on 9/24/2006 1:02 AM:
> Pardon me for putting my oar in but the syntax of tr varies quite a
> bit from system to system. It has been my experience that the only
> reliable way of expressing the above so that it will work on cygwin,
> linux, solaris, sun4, aix and irix is the following. It's probably
> more efficient to boot :-).
> tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'
More reliable, yes; in fact, this is what autoconf uses under the hood for
constructs like AS_TR_SH. But POSIX requires tr and sed to understand
[:upper:] and [:lower:], and to understand it in the context of the
current locale (there are some locales where blindly using the 26 letters
of English is the wrong behavior, and where you really do mean [:upper:]).
Life is short - so eat dessert first!
Eric Blake email@example.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v220.127.116.11 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html