home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / grep.cmd < prev    next >
OS/2 REXX Batch file  |  1993-12-13  |  2KB  |  44 lines

  1. :: GREP.CMD by Carl Distefano (CIS 70154,3452) for OS/2 [11/13/93]
  2. @echo off
  3. goto START
  4.  
  5. This batch file implements screen-pause and output-file features for
  6. Alexandre Polozoff's GREP utility for OS/2.  Before using GREP.CMD, you
  7. will need to configure it, as follows:
  8.  
  9. 1.  Copy GREP.CMD to a directory in your PATH, then open GREP.CMD with a
  10.     text editor.
  11. 2.  Change "[X:\PATH\]" below to the actual drive|path of GREP.EXE.
  12. 3.  Change each occurrence of "%RAMDRV%" below to the actual drive letter
  13.     for the GREP.LST output file (RAMdrive recommended).
  14. 4.  Change each occurrence of "-cisx" as desired.  Note, however, that
  15.     switch -c is *required* for this implementation.  If you wish, you can
  16.     omit all other switches and issue them on the command-line ad lib.
  17.  
  18. Usage:
  19. GREP [search-string] [filespec] -[switches]
  20.  
  21. Output displays one screen at a time, and is written to GREP.LST. 
  22. "Searching" status messages are filtered out.  Use your favorite text
  23. editor to browse or edit GREP.LST when the search is finished.  GREP.LST is
  24. *overwritten* with each new search.
  25.  
  26. To hear a beep upon completion, remove the colons preceding the final echo
  27. statement.  The beep is useful if you want to issue GREP as a background
  28. command, then return immediately to other work.  When the tone sounds, you
  29. can open GREP.LST in the foreground application, e.g., your word processor.
  30.  
  31. To delete GREP.LST automatically at the end of each run (i.e., treat it as
  32. an internal temp file), remove the colons preceding the DEL command.
  33.  
  34. Enjoy!
  35.  
  36. :START
  37. echo Working...
  38. echo GREP %1 %2 -cisx %3 > %RAMDRV%:\grep.lst
  39. echo IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII >> %RAMDRV%:\grep.lst
  40. [X:\PATH\]grep %1 %2 -cisx %3 | find /v "searching" >> %RAMDRV%:\grep.lst
  41. ::echo 
  42. type %RAMDRV%:\grep.lst | more
  43. ::del %RAMDRV%:\grep.lst
  44.