'\"macro stdmacro
.if n .pH g3g.gmatch @(#)gmatch	40.6 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} gmatch 3G "" "\&"
.if \nX=1 .ds x} gmatch 3G ""
.if \nX=2 .ds x} gmatch 3G "" "\&"
.if \nX=3 .ds x} gmatch "" "" "\&"
.TH \*(x}
.SH "NAME"
\f4gmatch\f1 \- shell global pattern matching
.SH "SYNOPSIS"
\f4cc\f1
[\f2flag\fP \|.\|.\|.] \f2file\fP \|.\|.\|.
\f4\-lgen\f1
[\f2library\fP \|.\|.\|.]
.PP
\f4#include <libgen.h>\f1
.PP
\f4int gmatch (const char \(**str, const char \(**pattern);\f1
.SH DESCRIPTION
\f4gmatch\fP checks whether the null-terminated string 
\f2str\fP
matches the null-terminated pattern string \f2pattern\f1.
See the \f4sh\fP(1) section ``File Name Generation'' for a discussion of pattern matching.
\f4gmatch\fP returns non-zero if the pattern matches the string,
zero if the pattern doesn't.  A backslash (`\f4\\\f1') is used
as an escape character in pattern strings.
.SH EXAMPLE
.RS
.ft 4
.nf
char \(**s;
.sp 0.5
gmatch (s, "\(**[a\\-]" )
.fi
.ft
.RE
.PP
\f4gmatch\fP
returns non-zero (true) for all strings with `\f4a\fP' or `\f4-\fP'
as their last character.
.SH "SEE ALSO"
\f4sh\fP(1) in the \f2User's Reference Manual\fP
