$matchtok

From Scriptwiki
Revision as of 18:19, 17 October 2005 by Doomie (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Returns tokens that contain the specified string.

$matchtok(tokens,string,N,C)

Note that if you specify zero for N, it returns the total number of matching tokens.

Example

echo -ag $matchtok(This is a test, is, 0, 32)

This example returns 2, as the string This is a test contains is two times (This and is).

echo -ag $matchtok(This is a test, is, 1, 32)

This example returns This as it's the first string containing is.