'tr' character class support?
jordan at geoghegan.ca
Fri Jul 10 17:26:43 EDT 2020
On 2020-07-10 14:15, Magnus Kroken wrote:
> Hi Jordan
> On 10.07.2020 22:45, Jordan Geoghegan wrote:
>> Hey folks,
>> Does the 'tr' utility support character classes in OpenWRT? I was
>> playing around with an OpenWRT x86_64 VM and I noticed that 'tr'
>> doesn't seem to support character classes.
>> The command " echo HELLO | tr '[:upper:]' '[:lower:]' " does not
>> convert to the text to lowercase as it should (and as required by
> This would be expected behavior. OpenWrt disables tr character classes
> in BusyBox by default, see :
> config BUSYBOX_DEFAULT_FEATURE_TR_CLASSES
> default n
> config BUSYBOX_DEFAULT_FEATURE_TR_EQUIV
> default n
> I don't know what the size cost in the BusyBox binary is, but that
> will likely be the deciding factor for such a change.
> Magnus Kroken
Thanks for confirming that so quickly.
I obviously understand that space saving is essential to OpenWRT, but
POSIX does require that 'tr' support character classes:
Represents all characters belonging to the defined character class, as defined by the current setting of the LC_CTYPE locale cate-
gory. The following character class names shall be accepted when specified in string1:
alnum blank digit lower punct upper
alpha cntrl graph print space xdigit
More information about the openwrt-devel