<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 31 Aug 1982 10:20:00-PDT
From   : chesley.tsca@Sri-Unix
Subject: Find pattern utility

       I've uploaded a find pattern utility to MC.  It will print out all
lines in a set of files containing a given pattern (similar to, but
simpler than Unix grep).
       There is complete documentation in the source, but in summary:

       It's called with:

               fp <pattern> <file(s)>

       It uses wildexp to expand the file names, so wildcards etc. can be
used.  <pattern> is a string of characters which must match some character
string in the line if that line is to be printed.  Most characters just
match themselves (ignoring case); the following have special meaning:

               ? - match any single character.
               * - match zero or more of any character.
               [<char-set>] - match any character in the set.
               [-<char-set>] - match any character not in the set.

       <char-set>s can be any string of characters.  Ranges can be
specified by "<char>-<char>".  E.g., [a-z0-9_] will match any letter,
number, or underscore.
       Backslash (\) can be used to quote characters (i.e., keep them
from being interpreted specially).

       The program can be conditionally compiled for either CP/M or
Unix, but I don't expect people to use it on Unix (grep is better).

       The following files are included:

       ar36:cpm;fp c   -- Find pattern main program.
       ar36:cpm;pat h  -- Header file for general pattern search utility.
       ar36:cpm;pat c  -- General pattern search utility.

       pat.h/pat.c are a more general pattern search utility, which could
be used in other areas.

       --Harry...
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>