[prev in list] [next in list] [prev in thread] [next in thread] 

List:       coreutils-bug
Subject:    Re: Suggestion for tr / transliteration binutil
From:       Pádraig_Brady <P () draigBrady ! com>
Date:       2008-08-27 10:13:41
Message-ID: 48B528D5.2020705 () draigBrady ! com
[Download RAW message or body]

smu johnson wrote:
> Hi,
> 
> I hope this is the right place to ask this.  I think a very handy argument
> to add to the list of aliases for character classes in tr would be a new one
> that behaves like [:cntrl:], except that it will not include newline
> characters in that class.
> 
> The reason is at work here I deal with XML data that people send us that has
> all sorts of strange characters in it, like ^@, ^Z, etc etc... and I'd like
> to use tr to quickly trip all this garbage out of there without it
> destroying the newline characters too...

This is not supported at present, but you may be able to get what you want with:
tr -c '[:print:]\n' .

Your suggestion has some merit though.
I've previously needed to do something similar:
http://code.google.com/p/fslint/source/browse/trunk/fslint-gui#122

Pádraig.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic