DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

gmatch(S)


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(C) 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(C)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005