1gmatch(3GEN) String Pattern-Matching Library Functions gmatch(3GEN)
2
3
4
6 gmatch - shell global pattern matching
7
9 cc [ flag ... ] file ... -lgen [ library ... ]
10 #include <libgen.h>
11
12 int gmatch(const char *str, const char *pattern);
13
14
16 gmatch() checks whether the null-terminated string str matches the
17 null-terminated pattern string pattern. See the sh(1), section File
18 Name Generation, for a discussion of pattern matching. A backslash (\)
19 is used as an escape character in pattern strings.
20
22 gmatch() returns non-zero if the pattern matches the string, zero if
23 the pattern does not.
24
26 Example 1 Examples of gmatch() function.
27
28
29 In the following example, gmatch() returns non-zero (true) for all
30 strings with "a" or "-" as their last character.
31
32
33 char *s;
34 gmatch (s, "*[a\-]" )
35
36
38 See attributes(5) for descriptions of the following attributes:
39
40
41
42
43 ┌─────────────────────────────┬─────────────────────────────┐
44 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
45 ├─────────────────────────────┼─────────────────────────────┤
46 │MT-Level │MT-Safe │
47 └─────────────────────────────┴─────────────────────────────┘
48
50 sh(1), attributes(5)
51
53 When compiling multithreaded applications, the _REENTRANT flag must be
54 defined on the compile line. This flag should only be used in multi‐
55 threaded applications.
56
57
58
59SunOS 5.11 29 Dec 1996 gmatch(3GEN)