bug-coreutils
[Top][All Lists]
Advanced

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

Re: [bug #22109] Enhancement request: tr should be able to take multiple


From: Richard Neill
Subject: Re: [bug #22109] Enhancement request: tr should be able to take multiple consecutive actions
Date: Fri, 25 Jan 2008 13:57:53 +0000
User-agent: Thunderbird 2.0.0.4 (X11/20070712)

Dear James,

Thanks for your detailed reply.

Could you provide some more justification than "would be nice" please?

Only that multiple instances of tr, piped together is rather ugly, and perhaps slower. However, as you point out, it's clearer to write

echo hello | tr h i | tr -s l

 than

echo hello | tr h i -s l


Implementing the change you suggest would significantly complicate the
implementation of tr, which is already quite fearsome; see for example the
recent discussion of the correct processing of "tr [:lower:] [:upper:]" in
locales where the number of upper-case letters is different to the number of
lower-case letters.

Ouch!

Such additional complexity doesn't come for free.  Somebody has to implement
it, the coreutils maintainers have to take the time to understand the new
implementation, they have to maintain and fix bugs in it.   Then the Info
documentation and the manual page need to be updated to explain the changed
functionality in such a way that any corner-cases are identified.

Agreed.


For example, what does this do?
tr -dc ABC -s

Does that do the same as this?

tr -d ABC -c -s

Both would be invalid, since -s is not followed by a set.


What about "tr -d ABC -c -s 123"? Is 123 SET1 or SET2?

123 is SET1, with respect to the preceeding -s.


I think the documentation task will be non-trivial.  Non-trivial
documentation will probably result, making it harder for people to understand.
 So everybody gets harder-to-understand documentation in the name of a
convenience feature.

The complex documentation and more complex implementation opens an
opportunity for the documentation to describe something slightly different to
the implementation.  When somebody notices the problem, which should get
fixed?

But this feature could indeed be convenient.  It could be sufficiently
convenient for many people to use it a lot.   Who will field their questions
when their script doesn't work - or silently does something different - on
other systems?

In summary, maybe nobody should change any piece of software, ever.   Except
maybe to fix bugs.  Carefully.  :)


OK - I agree. Thanks for your explanation - call that a wontfix :-)

Regards,

Richard



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?22109>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/






reply via email to

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