Pattern matching - unexpected output
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: bash
When using pattern matching with, for example, ls or rm, non matching patterns are selected. Mainly, case sensitivity seems to be functioning incorrectly, also, in some instances the search will arbitrarily recurse into subdirectories. This has been reproduced on multiple Ubuntu installations also running from Ubuntu 10.4 (32 bit) and Kubuntu 10.4 (64 bit) live CDs. Below is some sample output using ls, along with added comments.
kevin@navi:~/test$ ls -R # normal output showing directory contents
.:
A b capiTal Capital Dir lowercase
./Dir:
A b capiTal Capital lowercase
kevin@navi:~/test$ ls [a-d] #notice uppercase A file
A b
kevin@navi:~/test$ ls [A-D] # notice lowercase b file
A b
kevin@navi:~/test$ ls [a-d]* # notice lowercase & uppercase results (no recurse, as expected)
A b capiTal Capital
kevin@navi:~/test$ ls [a-z]* # notice lower & upper w/ recurse into sub directory
A b capiTal Capital lowercase
Dir:
A b capiTal Capital lowercase
kevin@navi:~/test$ ls [A-D]* # notice lower & upper w/ recurse into sub directory
A b capiTal Capital
Dir:
A b capiTal Capital lowercase
kevin@navi:~/test$ ls [A]* # normal output
A
kevin@navi:~/test$ ls [C]* # normal output
Capital
Thanks for taking the time to report this. This is probably the same as bug #120687, which discusses why this happens — your Locale defines how character ranges are handled. I'll mark this bug as a duplicate. Thanks!