shellexp
match string against a cruft filter pattern
- Provided by: cruft (Version: 0.9.40)
- Report a bug
match string against a cruft filter pattern
extern int shellexp(const char *string, const char *pattern);
The shellexp() function is similar to fnmatch(3), but works with cruft patterns instead of standard glob(7) patterns. The function returns a true value if string matches the cruft pattern pattern, and a false value (0) otherwise. Returns -1 in case of pattern syntax error.
Cruft patterns are similar to glob(7) patterns, but are not fully compatible. The following special characters are supported:
Any other character matches itself.
Uses constant-length 1000 byte buffers to hold filenames. Also uses recursive function calls, which are not very efficient. Does not validate the pattern before matching, so any pattern errors (unbalanced brackets or misplaced **) are only reported when and if the matching algorithm reaches them.
fnmatch(3), glob(3), cruft(8) and dash-search(1).
This manual page was written by Marcin Owsiany <porridge@debian.org>, for the Debian GNU/Linux system (but may be used by others).