{
    "content": [
        {
            "type": "text",
            "text": "# fnmatch(3) (man)\n\n**Summary:** fnmatch - compare a string against a filename wildcard\n\n**Synopsis:** @load \"fnmatch\"\nresult = fnmatch(pattern, string, flags)\n\n## Examples\n\n- `@load \"fnmatch\"`\n- `...`\n- `flags = or(FNM[\"PERIOD\"], FNM[\"NOESCAPE\"])`\n- `if (fnmatch(\"*.a\", \"foo.c\", flags) == FNMNOMATCH)`\n- `print \"no match\"`\n\n## See Also\n\n- filefuncs(3am)\n- fork(3am)\n- inplace(3am)\n- ordchr(3am)\n- dir(3am)\n- readfile(3am)\n- revoutput(3am)\n- rwarray(3am)\n- time(3am)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (4 lines)\n- **DESCRIPTION** (12 lines) — 4 subsections\n  - FNM[\"CASEFOLD\"] (8 lines)\n  - FNM[\"NOESCAPE\"] (2 lines)\n  - FNM[\"PATHNAME\"] (2 lines)\n  - FNM[\"PERIOD\"] (2 lines)\n- **NOTES** (3 lines)\n- **EXAMPLE** (6 lines)\n- **SEE ALSO** (5 lines)\n- **AUTHOR** (2 lines)\n- **COPYING PERMISSIONS** (16 lines)\n\n## Full Content\n\n### NAME\n\nfnmatch - compare a string against a filename wildcard\n\n### SYNOPSIS\n\n@load \"fnmatch\"\n\nresult = fnmatch(pattern, string, flags)\n\n### DESCRIPTION\n\nThe  fnmatch extension provides an AWK interface to the fnmatch(3) routine.  It adds a single\nfunction named fnmatch(), one predefined variable (FNMNOMATCH), and an array of flag  values\nnamed FNM.\n\nThe  first argument is the filename wildcard to match, the second is the filename string, and\nthe third is either zero, or the bitwise OR of one or more of the flags in the FNM array.\n\nThe return value is zero on success, FNMNOMATCH if the string did not match the pattern,  or\na different non-zero value if an error occurred.\n\nThe flags are follows:\n\n#### FNM[\"CASEFOLD\"]\n\nCorresponds to the FNMCASEFOLD flag as defined in fnmatch(3).\n\nFNM[\"FILENAME\"]\nCorresponds to the FNMFILENAME flag as defined in fnmatch(3).\n\nFNM[\"LEADINGDIR\"]\nCorresponds to the FNMLEADINGDIR flag as defined in fnmatch(3).\n\n#### FNM[\"NOESCAPE\"]\n\nCorresponds to the FNMNOESCAPE flag as defined in fnmatch(3).\n\n#### FNM[\"PATHNAME\"]\n\nCorresponds to the FNMPATHNAME flag as defined in fnmatch(3).\n\n#### FNM[\"PERIOD\"]\n\nCorresponds to the FNMPERIOD flag as defined in fnmatch(3).\n\n### NOTES\n\nNothing prevents AWK code from changing the predefined variable FNMNOMATCH, but doing so may\ncause strange results.\n\n### EXAMPLE\n\n@load \"fnmatch\"\n...\nflags = or(FNM[\"PERIOD\"], FNM[\"NOESCAPE\"])\nif (fnmatch(\"*.a\", \"foo.c\", flags) == FNMNOMATCH)\nprint \"no match\"\n\n### SEE ALSO\n\nGAWK: Effective AWK Programming, filefuncs(3am), fork(3am), inplace(3am), ordchr(3am),  read‐\ndir(3am), readfile(3am), revoutput(3am), rwarray(3am), time(3am).\n\nfnmatch(3).\n\n### AUTHOR\n\nArnold Robbins, arnold@skeeve.com.\n\n### COPYING PERMISSIONS\n\nCopyright © 2012, 2013, 2018, Free Software Foundation, Inc.\n\nPermission is granted to make and distribute verbatim copies of this manual page provided the\ncopyright notice and this permission notice are preserved on all copies.\n\nPermission is granted to copy and distribute modified versions of this manual page under  the\nconditions  for verbatim copying, provided that the entire resulting derived work is distrib‐\nuted under the terms of a permission notice identical to this one.\n\nPermission is granted to copy and distribute translations of this manual  page  into  another\nlanguage,  under  the above conditions for modified versions, except that this permission no‐\ntice may be stated in a translation approved by the Foundation.\n\n\n\nFree Software Foundation                     Feb 21 2018                                FNMATCH(3am)\n\n"
        }
    ],
    "structuredContent": {
        "command": "fnmatch",
        "section": "3",
        "mode": "man",
        "summary": "fnmatch - compare a string against a filename wildcard",
        "synopsis": "@load \"fnmatch\"\nresult = fnmatch(pattern, string, flags)",
        "flags": [],
        "examples": [
            "@load \"fnmatch\"",
            "...",
            "flags = or(FNM[\"PERIOD\"], FNM[\"NOESCAPE\"])",
            "if (fnmatch(\"*.a\", \"foo.c\", flags) == FNMNOMATCH)",
            "print \"no match\""
        ],
        "see_also": [
            {
                "name": "filefuncs",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/filefuncs/3am/json"
            },
            {
                "name": "fork",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/fork/3am/json"
            },
            {
                "name": "inplace",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/inplace/3am/json"
            },
            {
                "name": "ordchr",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/ordchr/3am/json"
            },
            {
                "name": "dir",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/dir/3am/json"
            },
            {
                "name": "readfile",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/readfile/3am/json"
            },
            {
                "name": "revoutput",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/revoutput/3am/json"
            },
            {
                "name": "rwarray",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/rwarray/3am/json"
            },
            {
                "name": "time",
                "section": "3am",
                "url": "https://www.chedong.com/phpMan.php/man/time/3am/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 12,
                "subsections": [
                    {
                        "name": "FNM[\"CASEFOLD\"]",
                        "lines": 8
                    },
                    {
                        "name": "FNM[\"NOESCAPE\"]",
                        "lines": 2
                    },
                    {
                        "name": "FNM[\"PATHNAME\"]",
                        "lines": 2
                    },
                    {
                        "name": "FNM[\"PERIOD\"]",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "EXAMPLE",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYING PERMISSIONS",
                "lines": 16,
                "subsections": []
            }
        ]
    }
}