home *** CD-ROM | disk | FTP | other *** search
- ; Call an external GREP utility and display the results in an EPM file.
-
- ; by Larry Margolis
-
- defc scan, grep =
- sayerror 'Scanning files...'
- call redirect('grep','/y /q /l' arg(1))
- if .last=0 then
- 'q'
- sayerror 'No hits.'
- endif
-
- defproc redirect(cmd)
- universal vTEMP_PATH
- outfile=vTEMP_PATH || substr(cmd'_______',1,8) || '.out'
- quietshell cmd arg(2) '>'outfile '2>&1'
- if RC = sayerror('Insufficient memory') or
- RC = sayerror('File Not found') then stop; endif
- 'e' outfile
- .filename='.Output from' cmd arg(2)
- call erasetemp(outfile)
-