home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Pier Shareware 6
/
The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso
/
035
/
bzgrep20.zip
/
grep.txt
< prev
Wrap
Text File
|
1994-11-02
|
3KB
|
96 lines
There has always been some things about GREP that I needed
that I didn't have... So I decided to apply myself and using
Borland C++ and some OO stuff put together my own version.
The only thing missing from this version which will be in
the next one is the support for unix-type regular
expressions...
The specific capabilities I longed for include recursive
search through sub-directories...
Being able to edit the files found by grep (have grep throw
you in edit on them)...
Being able to copy the files found to another sub-directory
keeping the "tree structure" in tact...
Full support for HPFS...
So here is the help that comes out if you leave off the
parameters....
All disclaimers apply... (e.g. Use it at your own risk... I
am releasing this version as freeware but retain the
copywrite) etc... Enjoy
bobzim@mcs.com (Bob Zimmerman)
Syntax: GREP options string wildcard /COPY=<directory> /EDIT=<editor>
Options can be:
-i Ignore Case
-f File Names Only - No matched lines
-r Recursive (all sub-directories)
-n Include Line Numbers
-t File Names Only - no total lines
-b Ignore Binary Files (OBJ, DLL, EXE, LIB)
-x Use Unix Regular Expressions (ignore -i)
/EX=<command>
After each matching file, prompts the user if the
specified command should be run against the file.
For example
/EX=EPM
prompts if the epm editor should edit the file.
You can "embed spaces" by surrounding the entire string
with quotes. For example
grep include *.cpp "/ex=start epm"
will "start epm" in a separate window.
Prior to running the "command"... any %f is translated to
the file name. %d is the directory name. %l is the line number
the first match was found on. %c is the column number
the first match was found on.
GREP_EX environment variable can be set to a command you use over
and over. So you can place your most often using /ex command
in this environment variable in config.sys. To turn on
the command specify /EX (without = sign).. For example:
grep include *.cpp /ex
It will use the environment variable. You can override the
environment variable by using the /ex= command:
grep include *.cpp "/ex=xcopy %f backup\*.* /v /e /s"
The above causes the GREP_EX environment variable to be
ignored.
Examples :
GREP include *.cpp
Search for word include in all CPP
GREP -irf xhandle *.?pp or
GREP -i -r -f xhandle *.?pp
Search for xhandle in all files ending
with PP (hpp, cpp, xpp) and search all
sub-directories as well. Only show the
file names that match (no text).
Version 1.5
Added Regular Expressions
Version 1.6
No longer requires c215.dll
Version 2.0
Has dos version of exe along with support for the /EX
parameter. /EDIT and /COPY are still supported for
compatability but you should use /EX now.