Name

mk_fnmatch_compile — Compile glob patterns to a function

Synopsis

mk_fnmatch_compile patterns...

Description

Generates a new shell function which acts as a matching predicate for patterns. When the generated function is invoked with the string path, it will return 0 (logical true) if mk_fnmatch path pattern would succeed for any pattern in patterns, and 1 (logical false) otherwise.

Sets result to the generated function. Be sure to use unset -f to undefine it when you are done.