GNU bug report logs -
#8587
Curious bug.
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
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 8587 <at> debbugs.gnu.org.
--
8587: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8587
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
tag 8587 notabug
close 8587
thanks
On 04/29/2011 01:09 PM, Francois Boisson wrote:
> On a debian squeeze amd64.
>
> francois <at> totoche:~$ echo ABCD Directory | tr [:lower:] [:upper:]
> ABCD DIRECTORY
> francois <at> totoche:~$ cd /tmp
> francois <at> 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 eblake <at> redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
[Message part 5 (message/rfc822, inline)]
On a debian squeeze amd64.
francois <at> totoche:~$ echo ABCD Directory | tr [:lower:] [:upper:]
ABCD DIRECTORY
francois <at> totoche:~$ cd /tmp
francois <at> totoche:/tmp$ echo ABCD Directory | tr [:lower:] [:upper:]
tr: construit [:upper:] et/ou [:lower:] mal aligné
francois <at> totoche:/tmp$ echo ABCD Directory | tr [:upper:] [:lower:]
llll lirectory
francois <at> totoche:/tmp$ cd
francois <at> totoche:~$ echo ABCD Directory | tr [:upper:] [:lower:]
abcd directory
francois <at> totoche:~$
francois <at> 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 <at> 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
This bug report was last modified 14 years and 27 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.