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

Re: bash glob bug?



On Tue, Sep 03, 2002 at 06:43:00PM -0600, Jason E. Stewart wrote:
> "wes schreiner" <wes@infosink.com> writes:
> 
> > Jason E. Stewart wrote:
> > 
> > >Hey All,
> > >
> > > I seemed to have found a bug in bash's globbing behavior. Can
> > > someone explain to me how the file functions-sql.xml can possibly
> > 
> > >be included in the ls command below?
> > >
> > >Cheers,
> > >jas.
> > >
> > >~/work/GeneX-Server/DB/xml $ ls -l [E-G]*.xml
> > >-rwxr-xr-x    1 jasons   jasons       1514 Jul 11 17:29 ExperimentFactors.xml
> > >-rwxr-xr-x    1 jasons   jasons       4237 Jul 11 17:29 ExperimentSet.xml
> > >-rwxr-xr-x    1 jasons   jasons       2090 Jul 11 17:29 ExternalDatabase.xml
> > >-rw-r--r--    1 jasons   jasons        687 Jul 11 17:29 FeatureExtraction.xml
> > >-rwxr-xr-x    1 jasons   jasons       5761 Jul 11 17:29 Feature.xml
> > >-rw-r--r--    1 jasons   jasons       2712 Jul 11 17:29 functions-sql.xml
> > >-rw-r--r--    1 jasons   jasons        915 Jul 11 17:29 GenexAdmin.xml
> > >-rwxr-xr-x    1 jasons   jasons       1198 Jul 11 17:29 GroupLink.xml
> > >-rwxr-xr-x    1 jasons   jasons       1859 Jul 11 17:29 GroupSec.xml
> > >
> > >
> > >
> > 
> > What locale are you using? (type "locale" and see) I have the default
> > "C" locale here and your example works as expected. Bash honors the
> > locale's collating sequence, so my guess is that your locale is set to
> > something other than "C", something that has a case-insensitive
> > collating sequence.
> 
> Ah. I have LANG=en_US. With C it works for me as well.
> 
> I still think it's a bug, though. Look at this:
> 
> ~/work/GeneX-Server/DB/xml $ ls -l [D-E]*.xml F*.xml
> -rwxr-xr-x    1 jasons   jasons       1514 Jul 11 17:29 ExperimentFactors.xml
> -rwxr-xr-x    1 jasons   jasons       4237 Jul 11 17:29 ExperimentSet.xml
> -rwxr-xr-x    1 jasons   jasons       2090 Jul 11 17:29 ExternalDatabase.xml
> -rw-r--r--    1 jasons   jasons        687 Jul 11 17:29 FeatureExtraction.xml
> -rwxr-xr-x    1 jasons   jasons       5761 Jul 11 17:29 Feature.xml
> 
> ~/work/GeneX-Server/DB/xml $ ls -l [D-F]*.xml 
> -rwxr-xr-x    1 jasons   jasons       1514 Jul 11 17:29 ExperimentFactors.xml
> -rwxr-xr-x    1 jasons   jasons       4237 Jul 11 17:29 ExperimentSet.xml
> -rwxr-xr-x    1 jasons   jasons       2090 Jul 11 17:29 ExternalDatabase.xml
> -rw-r--r--    1 jasons   jasons        687 Jul 11 17:29 FeatureExtraction.xml
> -rwxr-xr-x    1 jasons   jasons       5761 Jul 11 17:29 Feature.xml
> -rw-r--r--    1 jasons   jasons       2712 Jul 11 17:29 functions-sql.xml
> 
> It only seems to happen when the F is part of a character class. Is
> this how en_US is supposed to work?

Yes.  I believe it's DeEfF.  I use LANG=en_US, LC_TIME=C, LC_COLLATE=C.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



Reply to: