coreutils
coreutils copied to clipboard
tr: Should not accept unaligned [:upper:]
$ 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)
Fixed by #6445.
We have to reopen this issue as my PR fails to address the root problem.
this command line is fine in GNU tr but fails with uutils
tr '[:upper:][:lower:]' 'a-z[:upper:]'
Apparently GNU tr fully expands the tokens left of the upper in set2 and lower in set1 before checking.
This looks like it has been resolved by #6513, hasn't it? At least currently it works, and the test added by that PR looks very similar.
Yeah, this Issue is what that PR was all about