bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: foo* doesn't match when 'foobar' does; fname=FooBar on xfs w/naming


From: Marc Herbert
Subject: Re: foo* doesn't match when 'foobar' does; fname=FooBar on xfs w/naming "ci" option
Date: Fri, 21 May 2010 10:14:20 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]