Pattern matching gives unexpected results

Bug #553660 reported by Roberto
6
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=en_US.UTF-8
$ 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...

Revision history for this message
Roberto (rgs) wrote :

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?

Revision history for this message
Andrew McCarthy (andrewmccarthy) wrote :

Thanks for taking the time to report this issue. It looks to be the same as a much older bug (#120687) so I'm going to mark it as a duplicate. Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.