gmatch(3G)


gmatch -- shell global pattern matching

Synopsis

   cc [flag . . . ] file . . . -lgen [library] . . .
   

#include <libgen.h>

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 of pattern matching. gmatch returns non-zero if the pattern matches the string, zero if the pattern doesn't. A backslash (``\'') is used as an escape character in pattern strings.

Examples

char *s;

gmatch (s, "*[a\-]" )

gmatch returns non-zero (true) for all strings with `a' or `-' as their last character.

References

sh(1)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004