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: Should not accept unaligned [:upper:] #6341

Open
BenWiederhake opened this issue May 4, 2024 · 0 comments
Open

tr: Should not accept unaligned [:upper:] #6341

BenWiederhake opened this issue May 4, 2024 · 0 comments
Labels

Comments

@BenWiederhake
Copy link
Collaborator

$ echo -en '123456789' | tr -t "123456789" "[:upper:]"
tr: misaligned [:upper:] and/or [:lower:] construct
[$? = 1]
$ echo -en '123456789' | cargo run tr -t "123456789" "[:upper:]"
00000000  41 42 43 44 45 46 47 48  49                       |ABCDEFGHI|
00000009
$

Note that this really checks for alignment, not just presence:

$ echo -en '123abcABC' | tr -t "1[:lower:]" "[:upper:]_"
tr: misaligned [:upper:] and/or [:lower:] construct
[$? = 1]
$ echo -en '123abcABC' | cargo run tr -t "1[:lower:]" "[:upper:]_"
A23BCDABC

(Original issue: #6133)

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

1 participant