bugGNU Core Utilities - Bugs: bug #22109, Enhancement request: tr should be...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #22109: Enhancement request: tr should be able to take multiple consecutive actions

Submitter:  Richard Neill <richardneill>
Submitted:  Fri 25 Jan 2008 07:08:57 AM UTC
   
 
Category:  None Severity:  1 - Wish
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Fri 25 Jan 2008 02:52:02 PM UTC, comment #2: 

Closed per response on the mailing list.

Eric Blake <ericb>
Group administrator
Fri 25 Jan 2008 11:22:21 AM UTC, comment #1: 

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

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.  

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.   For example, what does this do? 

tr -dc ABC -s

Does that do the same as this?

tr -d ABC -c -s

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

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.  :)

James Youngman <jay>
Fri 25 Jan 2008 07:08:57 AM UTC, original submission:  

It would be nice if tr could take multiple consecutive actions in a single command. For example, instead of writing

  echo hello | tr h i | tr -s l | tr -d o     #result: iel

it would be nice to allow:

  echo hello | tr h i -s l -d o

where the operations are applied consecutively.


Thanks,

Richard

Richard Neill <richardneill>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ericb (Posted a comment)
  • -email is unavailable- added by jay (Posted a comment)
  • -email is unavailable- added by richardneill (Submitted the item)
  • -email is unavailable- added by richardneill
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-01-25 ericb Severity3 - Normal 1 - Wish
        StatusNone Wont Fix
        Open/ClosedOpen Closed
    2008-01-25 richardneill Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code