On 2/24/19 10:01 AM, Lukáš Bařinka wrote:

> Bash Version: 5.0
> Patch Level: 2
> Release Status: release
> 
> Description:
> Equivalence class in shell patterns does not work as expected. On the other
> hand, equivalence class does work in regular expressions in bash.
> 
> The problem is in shell patterns inside Extended test [[ ]], globbing and
> the case compound command.

Equivalance classes are hit-or-miss. The only public interface that you can
use outside of libc is strcoll(), and if strcoll doesn't return 0 for
characters in the same equivalence class (to impose a total ordering, for
instance), you're pretty much out of luck.

Bash-5.0 has an autoconf test to determine whether or not fnmatch() will
handle equivalence classes correctly, and compiles in a fallback to it if
it's successful. It does the trick on RHEL 7, for instance, but not on
Mac OS X or Debian.

Since the bash regular expression operators use the system's regexp engine,
which usually has access to this information as part of the libc internals,
it doesn't suffer the same problem.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to