Robert Citek wrote:
> $ echo '12345' | tr '[^1234]' 'x'
> xxxx5
Try:
echo '12345' | tr -c '[1234\n]' 'x'
1234x
The [xxx] string in tr is not a character class, but a list that just
looks similar, because you can use a dash to define a series.
And note that tr will transliterate EVERYTHING, including any newlines,
so you need to specify it.
And note the '-c' to use the complement operation which is what you want.
Tom
--~--~---------~--~----~------------~-------~--~----~
Central West End Linux Users Group (via Google Groups)
Main page: http://www.cwelug.org
To post: [email protected]
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
More options: http://groups.google.com/group/cwelug
-~----------~----~----~----~------~----~------~--~---