A report from the documentation maintainer
A report from the documentation maintainer
Posted Nov 3, 2016 15:45 UTC (Thu) by nybble41 (subscriber, #55106)In reply to: A report from the documentation maintainer by mstone_
Parent article: A report from the documentation maintainer
Exactly as I've been saying. And yet, enabling Unicode *character encoding* in your environment somehow implies to the shell that you want so-called "natural" sorting rather than traditional byte sorting, unless you take further steps to override LC_COLLATE. These are unrelated topics and there is no good reason for a change in character encoding to affect the sort order, or vice-versa.
There is nothing "unnatural" about sorting uppercase characters first to match the traditional behavior of the shell. This is no different from the common option to sort directories before regular files. For that matter there is nothing "unnatural" about sorting filenames as the byte strings they actually are, regardless of encoding, rather than by their locale-specific decoding into text. Only the byte-strings are guaranteed to be uniform system-wide; the text presented to the user depends on the current environment.
> especially the vast majority of people who couldn't write their own name with plain ASCII and the shortcut byte-ordering it facilitated
Again, separate issues. Nothing about byte-order sorting precludes the use of Unicode character encoding in filenames.
Anyway, this is getting rather far off-topic. The subject was glob patterns and the dubious wisdom of matching characters not specified by the user. If the user writes the glob [A-Z] that should be read as "the uppercase letters from A to Z", not "all letters except lowercase z" (using a range of letters in "natural" sort order) or "all letters" (using case-insensitive comparison). A user who went to the trouble of writing [A-Z] in uppercase obviously didn't intend to match [a-z]. Sort order is, for the most part, a matter of preference and not correctness; redefining the filenames which match a given glob pattern carries a much larger risk of data-loss.
As for the earlier objection that only a programmer would view things this way... the shell is a programming language! Anyone writing commands at the shell prompt is a programmer. If you want an interface designed for non-programmers, there are any number of GUI file managers and program launchers available.
