Pattern matching gives unexpected results
Bug #553660 reported by
Roberto
This bug report is a duplicate of:
Bug #120687: Caseless collate sequence in en_GB.UTF8.
Edit
Remove
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: bash
$ export LC_COLLATE=
$ touch a b c
$ ls [A-Z]
b c
Why do collation order in english (and many other locales) do exclude "a" but include "b" and "c" in previous expansion? Maybe this is correct behaviour by some obscure reason, but my poor brain fails to understand the logic behind it...
To post a comment you must log in.
Hey, I think I found the reason while sleeping :)
The pattern [A-Z] always excludes lowercase a, and:
$ ls [a-z]*
matches all files starting with any letter *except* the ones starting with uppercase Z (under most locales I've tested). It can be argued to be correct behaviour, but certainly counterintuitive IMHO.
Should this bug be changed to a wishlist for an explicit notice in manual page?