Interesting. I see the same behavior. Near as I can tell bash decided that the alphabet is:

aAbBcCdD...

I wouldn't expect that to be the case but when I played around with various file name that was the behavior I saw. So [a-c] includes upercase B while [a-b] does not. 'ls [A-c]*' will show Berry but not apple.

On Fri, 2015-06-19 at 09:29 -0400, Brett Russ wrote:
Can someone explain this to my evidently inadequately caffeinated brain? I was trying to use a lower case character range wildcard to list all files not starting with an uppercase letter and I noticed it wasn't working as I'd expect. So I created this simple example and still don't understand what's happening.

Dir with two files:

brett@spider /tmp/test $ \ls
apple  Berry

This is what I'd expect to see:

brett@spider /tmp/test $ \ls [a-b]*
apple

This makes no sense. Is this a bug?:

brett@spider /tmp/test $ \ls [a-c]*
apple  Berry

From here on are just a few extra examples confirming the oddity of the above.

brett@spider /tmp/test $ \ls [a]*
apple

brett@spider /tmp/test $ \ls [b]*
ls: cannot access [b]*: No such file or directory

brett@spider /tmp/test $ \ls [c]*
ls: cannot access [c]*: No such file or directory

brett@spider /tmp/test $ \ls a*
apple

brett@spider /tmp/test $ \ls b*
ls: cannot access b*: No such file or directory

brett@spider /tmp/test $ \ls c*
ls: cannot access c*: No such file or directory

brett@spider /tmp/test $ dpkg -S `which ls`
coreutils: /bin/ls

brett@spider /tmp/test $ dpkg -s coreutils
Package: coreutils
Essential: yes
Status: install ok installed
Priority: required
Section: utils
Installed-Size: 6020
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: foreign
Version: 8.21-1ubuntu5.1
[SNIP]


Thanks,
Brett
_______________________________________________
Wlug mailing list
Wlug@mail.wlug.org
http://mail.wlug.org/mailman/listinfo/wlug