This section describes how to match a wildcard pattern against a particular string. The result is a yes or no answer: does the string fit the pattern or not. The symbols described here are all declared in `fnmatch.h'.
0if they do match; otherwise, it returns the nonzero value
FNM_NOMATCH. The arguments pattern and string are both strings.
The argument flags is a combination of flag bits that alter the details of matching. See below for a list of the defined flags.
In the GNU C Library,
fnmatch cannot experience an "error"---it
always returns an answer for whether the match succeeds. However, other
fnmatch might sometimes report "errors".
They would do so by returning nonzero values that are not equal to
These are the available flags for the flags argument:
FNM_FILE_NAME; it comes from POSIX.2. We don't recommend this name because we don't use the term "pathname" for file names.
FNM_FILE_NAME, then the special treatment applies to `.' following `/' as well as to `.' at the beginning of string. (The shell uses the
FNM_FILE_NAMEflags together for matching file names.)
FNM_NOESCAPE, then `\' is an ordinary character.
Go to the first, previous, next, last section, table of contents.