GNU bug report logs - #17121
tr result is different when executed in /usr/bin

Previous Next

Package: coreutils;

Reported by: Benoît DUNAND-LAISIN <benoit.dunand-laisin <at> prologism.fr>

Date: Thu, 27 Mar 2014 15:49:01 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


Message #21 received at 17121 <at> debbugs.gnu.org (full text, mbox):

From: Benoît DUNAND-LAISIN
 <benoit.dunand-laisin <at> prologism.fr>
To: Pádraig Brady <P <at> draigbrady.com>, 
 mail <at> bernhard-voelker.de, eblake <at> redhat.com
Cc: 17121 <at> debbugs.gnu.org
Subject: Re: bug#17121: tr result is different when executed in /usr/bin
Date: Fri, 28 Mar 2014 12:13:48 +0100
[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)]

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.