Seth Woolley's Man Viewer

fnmatch(3) - fnmatch, fnmatch - match filename or pathname - man 3 fnmatch

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

FNMATCH(3)                 Linux Programmer's Manual                FNMATCH(3)



NAME
       fnmatch - match filename or pathname

SYNOPSIS
       #include <fnmatch.h>

       int fnmatch(const char *pattern, const char *string(3,n), int flags);

DESCRIPTION
       The  fnmatch()  function checks whether the string(3,n) argument matches the
       pattern argument, which is a shell wildcard pattern.

       The flags argument modifies the behaviour; it is the bitwise OR of zero
       or more of the following flags:

       FNM_NOESCAPE
              If  this  flag is set(7,n,1 builtins), treat backslash as an ordinary character,
              instead of an escape character.

       FNM_PATHNAME
              If this flag is set(7,n,1 builtins), match a slash in(1,8) string(3,n) only with  a  slash
              in(1,8) pattern and not, for example, with a [] - sequence containing
              a slash.

       FNM_PERIOD
              If this flag is set(7,n,1 builtins), a  leading  period  in(1,8)  string(3,n)  has  to  be
              matched  exactly by a period in(1,8) pattern.  A period is considered
              to be leading if(3,n) it is the first character in(1,8) string(3,n), or if(3,n) both
              FNM_PATHNAME  is set(7,n,1 builtins) and the period immediately follows a slash.

       FNM_FILE_NAME
              This is a GNU synonym for FNM_PATHNAME.

       FNM_LEADING_DIR
              If this flag (a GNU extension) is set(7,n,1 builtins), the pattern is considered
              to  be  matched if(3,n) it matches an initial segment of string(3,n) which
              is followed by a slash.  This flag is mainly  for  the  internal
              use of glibc and is only implemented in(1,8) certain cases.

       FNM_CASEFOLD
              If  this  flag  (a GNU extension) is set(7,n,1 builtins), the pattern is matched
              case-insensitively.

RETURN VALUE
       Zero if(3,n) string(3,n) matches pattern, FNM_NOMATCH if(3,n) there  is  no  match  or
       another non-zero value if(3,n) there is an error.

CONFORMING TO
       ISO/IEC  9945-2:  1993  (POSIX.2).  The FNM_FILE_NAME, FNM_LEADING_DIR,
       and FNM_CASEFOLD flags are GNU extensions.

SEE ALSO
       sh(1), glob(1,3,7,n)(3), scandir(3), glob(1,3,7,n)(7)



GNU                               2000-10-15                        FNMATCH(3)

References for this manual (incoming links)