Le 21/05/2010 09:32, Linda Walsh a écrit : > I'm not sure if this is bash specific...I'd wager not, but I'm not sure where > to > put it.
I guess it is not. > I created an xfs file system with the naming version=ci, (case-ignore) flag. > > This causes it to match filenames with case ignored. > > So an exact match of a file name matches with the case begin ignored, > i.e. 'foobar' matches 'FooBar'. > > But foo* doesn't match. I think your design problem is that you are trying to perform half of matching in the shell, and then the other half in the filesystem. If bash is in case-sensitive mode (the default), then bash will expands foo* to... foo*. Because there is no file starting with lower case foo. Then bash will pass this literal star string to xfs. But xfs does not seem to implement globbing. So xfs will look for 'foo*', 'Foo*', 'FOO*', 'fOo*' with a literal star. > The bash option to ignore case in wildcards wouldn't be a correct > option for this, as that would cause it to ignore case on all file > systems (if I understand it correctly). Correct because bash does not care about filesystems. This is too low level for bash (at least in this filename case). > So how can I get case ignored in wildcards, but only on this file > system -- consistent with it's creation options? (version=ci is an > option at file system creation time). You could try to implement (case-insensitive) *globbing* in xfs. Quite a challenge I guess! > Does bash use a generic regex library or does it have its own? Warning: globbing is different from regular expressions. Cheers, Marc