[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: regexps and locales
From: |
Chet Ramey |
Subject: |
Re: regexps and locales |
Date: |
Tue, 1 Feb 2005 12:33:11 -0500 |
> However it does seem that the pattern "?" should only match
> one-character-long filenames, whereas currently in bash it also
> matches any one-byte-long filename.
Isn't a one-byte-long filename still a valid filename? As far as I know,
as long as you can get a one-byte filename created, readdir will return
it, and `?' should match it.
> > any file, even if POSIXLY_CORRECT is set. I think the POSIX
> > specification says it should only match those files whose names are
> > valid sequences of characters according to the current locale. For
> > instance, when using a UTF-8 locale, it should not match the file
> > whose name is the output of "echo -e \\351".
I don't think Posix says that; it says that `?' matches `a character'. If
you have a filename returned by readdir, and you're in a multibyte locale,
`?' will match a character, wide or not.
> > touch $(echo -e \\351)
I was never able to get this to actually create a file, by the way, whether
or not I had specified a multibyte locale, using MacOS X.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live...Laugh...Love
Chet Ramey, ITS, CWRU chet@po.cwru.edu http://tiswww.tis.cwru.edu/~chet/
- Re: regexps and locales,
Chet Ramey <=