GNU bug report logs -
#17121
tr result is different when executed in /usr/bin
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17121 in the body.
You can then email your comments to 17121 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-coreutils <at> gnu.org
:
bug#17121
; Package
coreutils
.
(Thu, 27 Mar 2014 15:49:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Benoît DUNAND-LAISIN <benoit.dunand-laisin <at> prologism.fr>
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Thu, 27 Mar 2014 15:49:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Problem discovered in tr (GNU coreutils) 8.13 on a Ubuntu 12.04.
Running those commands:
cd $HOME
echo "Linux" | tr [:upper:] [:lower:]
will result: linux
Running the same from /usr/bin:
cd /usr/bin
echo "Linux" | tr [:upper:] [:lower:]
will result: winux
which is obviously a bad answer.
In debug mode:
sh -xc "echo "Linux" | tr [:upper:] [:lower:]"
+ echo Linux
+ tr [:upper:] w
winux
Regards.
[Message part 2 (text/html, inline)]
Added tag(s) notabug.
Request was from
Eric Blake <eblake <at> redhat.com>
to
control <at> debbugs.gnu.org
.
(Thu, 27 Mar 2014 16:07:01 GMT)
Full text and
rfc822 format available.
Reply sent
to
Eric Blake <eblake <at> redhat.com>
:
You have taken responsibility.
(Thu, 27 Mar 2014 16:07:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Benoît DUNAND-LAISIN <benoit.dunand-laisin <at> prologism.fr>
:
bug acknowledged by developer.
(Thu, 27 Mar 2014 16:07:04 GMT)
Full text and
rfc822 format available.
Message #12 received at 17121-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
tag 17121 notabug
thanks
On 03/27/2014 03:43 AM, Benoît DUNAND-LAISIN wrote:
> Problem discovered in tr (GNU coreutils) 8.13 on a Ubuntu 12.04.
>
> Running those commands:
>
> cd $HOME
> echo "Linux" | tr [:upper:] [:lower:]
Underquoted. Run:
echo [:upper:] [:lower:]
and then
echo "[:upper:]" "[:lower:]"
in the two directories to spot the difference. (Hint - in one of your
two directories, a shell glob is matching a one-byte file name)
As this is user error and not a bug in tr, I'm marking this bug as
closed, but feel free to add more comments if you still need help
understanding the issue.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#17121
; Package
coreutils
.
(Thu, 27 Mar 2014 16:47:02 GMT)
Full text and
rfc822 format available.
Message #15 received at 17121 <at> debbugs.gnu.org (full text, mbox):
On 03/27/2014 05:06 PM, Eric Blake wrote:
>> echo "Linux" | tr [:upper:] [:lower:]
>
> Underquoted. Run:
>
> echo [:upper:] [:lower:]
>
> and then
>
> echo "[:upper:]" "[:lower:]"
>
> in the two directories to spot the difference. (Hint - in one of your
> two directories, a shell glob is matching a one-byte file name)
FWIW: here, the 'w' program comes from the 'procps' package:
$ ls -l /usr/bin/[:lower:]
-rwxr-xr-x 1 root root 18896 Dec 17 16:58 /usr/bin/w
$ /usr/bin/w --version
w from procps-ng 3.3.8
Have a nice day,
Berny
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#17121
; Package
coreutils
.
(Thu, 27 Mar 2014 16:54:02 GMT)
Full text and
rfc822 format available.
Message #18 received at 17121 <at> debbugs.gnu.org (full text, mbox):
tag 17121 notabug
close 17121
stop
On 03/27/2014 09:43 AM, Benoît DUNAND-LAISIN wrote:
> Problem discovered in tr (GNU coreutils) 8.13 on a Ubuntu 12.04.
>
> Running those commands:
>
> cd $HOME
> echo "Linux" | tr [:upper:] [:lower:]
>
> will result: linux
>
> Running the same from /usr/bin:
>
> cd /usr/bin
> echo "Linux" | tr [:upper:] [:lower:]
>
> will result: winux
> which is obviously a bad answer.
>
> In debug mode:
>
> sh -xc "echo "Linux" | tr [:upper:] [:lower:]"
> + echo Linux
> + tr [:upper:] w
> winux
You debugged correctly but failed to see that
tr was getting passed the wrong options. See 'w' above.
That's because the shell is interpreting the [...]
You need to quote it:
$ echo 'Linux' | tr '[:upper:]' '[:lower:]'
thanks,
Pádraig.
p.s. cd without the $HOME changes to the home directory
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#17121
; Package
coreutils
.
(Fri, 28 Mar 2014 11:14:01 GMT)
Full text and
rfc822 format available.
Message #21 received at 17121 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Thanks for your explanations.
Regards,
Benoit
2014-03-27 17:00 GMT+01:00 Pádraig Brady <P <at> draigbrady.com>:
> tag 17121 notabug
> close 17121
> stop
>
> On 03/27/2014 09:43 AM, Benoît DUNAND-LAISIN wrote:
> > Problem discovered in tr (GNU coreutils) 8.13 on a Ubuntu 12.04.
> >
> > Running those commands:
> >
> > cd $HOME
> > echo "Linux" | tr [:upper:] [:lower:]
> >
> > will result: linux
> >
> > Running the same from /usr/bin:
> >
> > cd /usr/bin
> > echo "Linux" | tr [:upper:] [:lower:]
> >
> > will result: winux
> > which is obviously a bad answer.
> >
> > In debug mode:
> >
> > sh -xc "echo "Linux" | tr [:upper:] [:lower:]"
> > + echo Linux
> > + tr [:upper:] w
> > winux
>
> You debugged correctly but failed to see that
> tr was getting passed the wrong options. See 'w' above.
> That's because the shell is interpreting the [...]
> You need to quote it:
>
> $ echo 'Linux' | tr '[:upper:]' '[:lower:]'
>
> thanks,
> Pádraig.
>
> p.s. cd without the $HOME changes to the home directory
>
[Message part 2 (text/html, inline)]
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 25 Apr 2014 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 11 years and 61 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.