For the past few months, I've been learning about the command line with the help of William E. Shotts' The Linux Command Line. The Linux Command Line remains a popular book for newbies who would like to learn more about the Linux command line.
In one of the chapters, it introduces the
tr command. The book says that character sets can be constructed in one of three ways: an enumerated list such as
ABCDEFGHIJKLMNOPQRSTUVWXYZ; a character range, such as
A-Z; and POSIX character classes, such as
The part that I don't understand is when the book tells the reader to be wary about using character ranges for the character set because of the locale collation order, and suggests that the reader use POSIX character classes instead.
I've personally never encountered a problem using character ranges such as
echo "lowercase letters" | tr a-z A-Z
so why should I refrain from using character ranges in favor of POSIX character classes?
In case you are wondering, my locale is en_US.UTF-8.