Subject: bug#8587: closed (Re: bug#8587: Curious bug.)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 29 Apr 2011 20:54:02 +0000

Your bug report

#8587: Curious bug.

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
8587: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8587
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#8587: Curious bug.
From: Eric Blake <[email-masked]>
To: Francois Boisson <[email-masked]>
Cc: [email-masked]
Date: Fri, 29 Apr 2011 14:53:35 -0600
List-Id: <debbugs-submit.debbugs.gnu.org>

tag 8587 notabug
close 8587
thanks

On 04/29/2011 01:09 PM, Francois Boisson wrote:
> On a debian squeeze amd64.
> 
> francois@totoche:~$ echo ABCD Directory | tr [:lower:] [:upper:] 
> ABCD DIRECTORY
> francois@totoche:~$ cd /tmp
> francois@totoche:/tmp$ echo ABCD Directory | tr [:lower:] [:upper:] 
> tr: construit [:upper:] et/ou [:lower:] mal aligné

Thanks for the report.  However, this is not a bug in tr, but in your
usage of the shell.

Unquoted, the expression (without "") "[:lower:]" is the glob that
expands to any of the existing files: ":", "l", "o", "w", "e", "r"; and
if none of those files exists, then the glob is passed verbatim to tr.
Your results differed depending on whether the directory you were in had
files by those names.

But if you had used shell quoting, as in "'[:lower:]'", then there would
be no chance for the shell to do globbing.  That is, you meant to do:

echo ABCD Directory | tr '[:lower:]' '[:upper:]'

and were only getting lucky that there weren't any one-character file
names in your first directory.

-- 
Eric Blake   [email-masked]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Subject: Curious bug.
From: Francois Boisson <[email-masked]>
To: [email-masked]
Date: Fri, 29 Apr 2011 21:09:43 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

On a debian squeeze amd64.

francois@totoche:~$ echo ABCD Directory | tr [:lower:] [:upper:] 
ABCD DIRECTORY
francois@totoche:~$ cd /tmp
francois@totoche:/tmp$ echo ABCD Directory | tr [:lower:] [:upper:] 
tr: construit [:upper:] et/ou [:lower:] mal aligné
francois@totoche:/tmp$ echo ABCD Directory | tr [:upper:] [:lower:] 
llll lirectory
francois@totoche:/tmp$ cd
francois@totoche:~$ echo ABCD Directory | tr [:upper:] [:lower:] 
abcd directory
francois@totoche:~$ 

francois@totoche:/tmp/g$ tr --version
tr (GNU coreutils) 7.4
Copyright © 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 ou ultérieure
<http://gnu.org/licenses/gpl.html>. Ceci est un logiciel "libre" : vous êtes
libre de le modifier et de le redistribuer. Ce logiciel n'offre pas d'autre
garantie que celle imposée par la loi.

Écrit par Jim Meyering.
francois@totoche:/tmp/g$ 

ii  libc6          2.10.2-2       GNU C Library: Shared libraries
ii  coreutils      7.4-2          The GNU core utilities

I can give you more informations if you want.

Thanks for this work.

François Boisson