Bug 14331 - tr doesn’t understand [:class:] character classes
Summary: tr doesn’t understand [:class:] character classes
Status: RESOLVED INVALID
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: 1.30.x
Hardware: All All
: P5 critical
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-07 19:29 UTC by Christoph Anton Mitterer
Modified: 2021-11-07 22:55 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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