Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ gmatch(3G) — SunOS 5.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sh(1)

gmatch(3G)

NAME

gmatch − shell global pattern matching

SYNOPSIS

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

#include <libgen.h>

int gmatch(const char ∗str, const char ∗pattern);

MT-LEVEL

Unsafe

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.  A backslash (\) is used as an escape character in pattern strings. 

RETURN VALUES

gmatch() returns non-zero if the pattern matches the string, zero if the pattern does not. 

EXAMPLE

In the following example, gmatch() returns non-zero (true) for all strings with “a” or “-” as their last character. 

char ∗s;
gmatch (s, "∗[a\-]" )

SEE ALSO

sh(1)

SunOS 5.2  —  Last change: 22 Jan 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026