When did linux become caseless?
David Precious
davidp at preshweb.co.uk
Fri Jun 15 11:23:36 BST 2007
Dirk Koopman wrote:
> Subject says it all really. Just did "rm [A-Z]*" and had a load of files
> with lower case first letters removed as well. Same thing happens for
> "ls -d [A-Z]*"
>
> I am guessing that this some bash argument expansion option. Any ideas
> as to how to get the correct behaviour?
Hmm....
[davidp at ruthenium:/tmp/case]$ shopt | grep case
nocaseglob off
nocasematch off
They look to be likely suspects :)
[davidp at ruthenium:/tmp/case]$ touch foo FOO bar BAR
[davidp at ruthenium:/tmp/case]$ ls [A-Z]*
BAR FOO
[davidp at ruthenium:/tmp/case]$ shopt -s nocaseglob
[davidp at ruthenium:/tmp/case]$ ls [A-Z]*
BAR FOO bar foo
Yup.
a shopt -u nocaseglob ought to fix it.
(Does Ubuntu have that set by default??)
--
David Precious
http://blog.preshweb.co.uk/ :: http://www.preshweb.co.uk/
More information about the london.pm
mailing list