Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
BenWiederhake opened this issue Jun 10, 2024 · 1 comment
Labels

Comments

@BenWiederhake
Copy link
Collaborator

BenWiederhake commented Jun 10, 2024

$ 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.

@cvonelm
Copy link
Contributor

cvonelm commented Jun 30, 2024

a46e4fd decided this in favor of sticking with GNU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants