I'm trying to test the limits of the tr command using character ranges. What I don't get is how come I get the output:
lowercase letters
when typing:
echo "lowercase letters" | tr A-Z A-Z
instead of:
LOWERCaSE LETTERS
?
My locale is set to dictionary order aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ. In principle, the "a" in "lowercase letters" shouldn't be changed, since "a" comes before "A". The thing I don't get is how come the other letters in "lowercase letters" aren't capitalized? Shouldn't they all be capitalized given that they are all located between "A" and "Z" in dictionary order?
echo "lowercase letters" | LC_ALL=C tr A-Z A-Z
Does that give the same output ?A-Z
doesn't expand the dictionary order. It expands to all ascii characters from A to Z. Since inlowercase letters
there's no capitals, nothing gets changed