home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
txtutl
/
ddjgrep.arc
/
README
< prev
next >
Wrap
Text File
|
1987-11-04
|
3KB
|
60 lines
The grep routines were from the October 1984 Dr. Dobbs.
It has five parts (1) tools.h (2) tools.c (3) grep.c (4) bitmap.c (5) queue.c.
I put in the update from the June 1985 Dr.Dobbs that utilized the bitmaps and
queue routines.
Since I hand entered these routines I did not put in the comments; If you are
interested look up a back issue. It was compiled under MSC 4.0, with modified
startup routines to use wild card expansion from the command line, and double
quote mechanism. The routines have been modified slightly I took out the
references to CPM in the different files.
In other words if you say grep "this is one arg" filename
there are three arguements.
To pass quotes in the pattern use a backslash and quote,
grep "\"this puts a quote in the pattern\""
Hope this is not too unclear.
The flags are:
-v all lines but thos matching are printed
-c only a count of the matching lines are printed
-l the name of the files withe matching lines are listed (once)
seperated by newlines.
-n each line is preceded by its line number in the file
-h do not print filename headers with output lines
-y all characters in the file are mapped to upper case before
matching
-e <expression> same as a simple expression, useful if the
expression begins with a '-'
-f <file> the regular expression is taken from the file. If
several regular expressions are listed (seperated by
newlines or | 's) then a match will be flagged if any of
the regular expressions are satisfied.
-e and -f are mutually exclusive, if -f is given, any regular
expression on the command line is toaken to be a filename.
example: grep -n "^[a-z][a-z]*[\s\t]*.*([^;]*)[^;]*$" <file list>
this creates a cross reference of a C program, file list
to be replaced by name name name or name.* or some such
combination. If the pattern is in a file '-f' don' use the
surrounding double quotes.
example: grep -n "TRUE|FALSE|MAYBE" <file list>
this looks for the pattern TRUE or FALSE or MAYBE at the same
time.
All features of the unix version of grep are supported except the -s, -x and
-b options and the metacharacters (,),+ and ?.
This was done when version 7 was the prevelant version of unix.
If you dont want to use this as grep the routines may be useful in their own
right in an editor or whatever way that you want to use them.
Have Fun
Don