Amiga Unix — 68040 · 68060

Manual pages › General-purpose library (3G)

gmatch(3G)

shell global pattern matching

From the original Amiga UNIX 2.1 manual. Some things it mentions may not be in this release.

NAME

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.

EXAMPLE

char *s;

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

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

SEE ALSO

sh(1) in the User's Reference Manual