This is a discussion on Is tr broken? Doesn't seem to process char classes correctly. within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> I've shown 2 versions of tr operating below. Version 5 from slackware 10. And version 2 from slackware 7. ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I've shown 2 versions of tr operating below. Version 5 from slackware 10. And version 2 from slackware 7. Version 2 of tr appears to working as expected, but version 5 doesn't. Version 5 behaves abnormally on other char classes as well. # tr version 5.2.1 appears to behave abnormally. # Delete all punct chars using tr version 5.2.1 from Slackware 10.0 # note that \260 and \250 are not punct chars, but are deleted. /bin/echo -e '\260\250?' | tr -d '[ 0000000: 0a . # Delete all non-punct chars using tr version 5.2.1 from Slackware 10.0 # Note that \260 and \250 are non punct chars and should be deleted, but # are not. The newline is deleted correctly. 'b0' is \260, 'a8' is \250. /bin/echo -e '\260\250?' | tr -dc '[ 0000000: b0a8 3f ..? # tr version 2.0 appears to behave normally. # Delete all punct chars using tr version 2.0 from Slackware 7 # This behaves normally (to me). Only the '?' is deleted. /bin/echo -e '\260\250?' | tr -d '[ 0000000: b0a8 0a ... # Delete all non-punct chars using tr version 2.0 from Slackware 7 # This behaves normally (to me). All but the '?' are deleted. /bin/echo -e '\260\250?' | tr -dc '[ 0000000: 3f ? Is the new tr ok? |