Bug 14331

Summary: tr doesn’t understand [:class:] character classes
Product: Busybox Reporter: Christoph Anton Mitterer <calestyo>
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED INVALID    
Severity: critical CC: busybox-cvs
Priority: P5    
Version: 1.30.x   
Target Milestone: ---   
Hardware: All   
OS: All   
Host: Target:
Build:

Description Christoph Anton Mitterer 2021-11-07 19:29:45 UTC
Hey.

Unlike mandated by POSIX:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/tr.html

busybox' tr doesn't seem to understand any of the character classes,... and I'd guess neither the other formats given in the EXTENDED DESCRIPTION of POSIX.

Not only does it not understand this, but it even takes such characters literal so e.g. when using
busybox tr -d '[:alpha:]'
it will remove 'a' and so on.

Cheers,
Chris.
Comment 1 Ron Yorston 2021-11-07 21:30:24 UTC
Character classes should work with the default build configuration, though they can be disabled by turning off FEATURE_TR_CLASSES. Is it possible that's the case for the binary you're using?
Comment 2 Christoph Anton Mitterer 2021-11-07 22:06:08 UTC
Indeed, Debian seems to have disabled this.

Sorry for the noise.

Thanks,
Chris.
Comment 3 Christoph Anton Mitterer 2021-11-07 22:55:08 UTC
Just for the records, forwarded downstream to:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998803