bug-coreutils
[Top][All Lists]
Advanced

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

Re: bug tr remove some characters when used with -s


From: Eric Blake
Subject: Re: bug tr remove some characters when used with -s
Date: Tue, 31 Mar 2009 10:47:30 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

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

According to Saïvann on 3/31/2009 9:42 AM:
> I used tr to filter locale names in a debian package but I got a problem
> with a specific field. When using tr with "-s", it removes a "n" in
> "nn-NO". You can reproduce this bug simply with this command in a terminal :
> 
> echo "nn-NO" | tr -s A-Z a-z
> 
> The bug is not reproducible with this command :
> 
> echo "nn-NO" | tr A-Z a-z

Not a bug.  That is the documented behavior of -s, per 'tr --help':

|   -s, --squeeze-repeats   replace each input sequence of a repeated
character
|                             that is listed in SET1 with a single occurrence
|                             of that character
...
| -s uses SET1 if not
| translating nor deleting; else squeezing uses SET2 and occurs after
| translation or deletion.

Since n is a member of SET2, it is squeezed after the translation phase,
regardless of whether translation was what caused the creation of a
consecutive nn.

> I don't know if that is intended but it looks like a bug. I'm currently
> using coreutils 6.10-6ubuntu1 on ubuntu.

Consider upgrading.  The latest stable version is 7.2.

- --
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

iEYEARECAAYFAknSSSIACgkQ84KuGfSFAYBiKQCgv9jMQx3eI6QUyWZ2nUYRje0m
t5MAoJym//Iwnwa2tL1zptPAHrHf2XYh
=BrF5
-----END PGP SIGNATURE-----




reply via email to

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