String Pattern-Matching Library Functions gmatch(3GEN)
NAME
gmatch - shell global pattern matching
SYNOPSIS
cc [ flag ... ] file ... -lgen [ library ... ]
#include
int gmatch(const char *str, const char *pattern);
DESCRIPTION
gmatch() checks whether the null-terminated string str
matches the null-terminated pattern string pattern. See the
sh(1), section File Name Generation, for a discussion ofpattern matching. A backslash (\) is used as an escape char-
acter in pattern strings.RETURN VALUES
gmatch() returns non-zero if the pattern matches the string,
zero if the pattern does not.EXAMPLES
Example 1 Examples of gmatch() function.
In the following example, gmatch() returns non-zero (true)
for all strings with "a" or "-" as their last character.
char *s;gmatch (s, "*[a\-]" )
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| MT-Level | MT-Safe |
|_____________________________|_____________________________|
SEE ALSO
sh(1), attributes(5) NOTESWhen compiling multithreaded applications, the _REENTRANT
flag must be defined on the compile line. This flag shouldSunOS 5.11 Last change: 29 Dec 1996 1
String Pattern-Matching Library Functions gmatch(3GEN)
only be used in multithreaded applications.SunOS 5.11 Last change: 29 Dec 1996 2