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?:
This is probably more bash than ls. When you use `*' on a command line, the shell does filename glob expansion; the results of the glob expansion become arguments (to ls, in this case). Out of the box, I've always seen bash do case sensitive globs, but you can change this. # four files $ touch ax Ax bx Bx # all files starting with `a' $ ls a* ax # make glob expansion case insensitive $ shopt -s nocaseglob $ ls a* Ax ax # make it case sensitive again $ shopt -u nocaseglob $ ls a* ax If you actually want to see how the glob is expanded $ sh -x -c "ls [aA]*" + ls Ax ax <<< glob expansion Ax ax Steve