coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

tr: GNU refuses sensible longer-than-class input, should we refuse it, too?

Open BenWiederhake opened this issue 1 year ago • 1 comments

$ true | cargo run -q tr '[:lower:]a' '[:upper:]'
$ true | tr '[:lower:]a' '[:upper:]'
tr: when translating with string1 longer than string2,
the latter string must not end with a character class
[$? = 1]
$ true | tr -t '[:lower:]a' '[:upper:]'

I see two options:

  • Either we claim this is an extension of tr, in that case we should document it on https://uutils.github.io/coreutils/docs/extensions.html
  • Or this is a bug (because it's a difference in behavior to GNU), then we should fix that. Make sure you catch that weird case where truncating removes the warning again!

Found while reading #6445, even though it wasn't introduced there.

BenWiederhake avatar Jun 10 '24 21:06 BenWiederhake

a46e4fd decided this in favor of sticking with GNU

cvonelm avatar Jun 30 '24 10:06 cvonelm