grep - Execute grep command rgrep - Execute recursive grep command
grep "expression files..." rgrep "expression" "base-path" "file-mask"
grep executes the grep(1) command with the command line set by the %grep-com(5) variable and the user supplied expression and file list files.... The output of the command is piped into the *grep* buffer ready for the get-next-line(2) command to step through all matched lines. The syntax from the grep output must be setup using add-next-line(2).
If an argument is given then a pipe-shell-command(2) is used instead of ipipe-shell-command(2), this is useful when used in macros as it ensures that grep has finished before the command returns.
rgrep is simpler to grep in that it uses grep(1) to search for all occurrences of expression, but rgrep also uses find(1) to search for expression in all files matching the file-mask in all directories from base-path down.
grep is a macro defined in tools.emf.
grep(1) must be executable on the system before grep or rgrep can function, find(1) must also be available for rgrep to work.
The grep command is generally set up in the startup files as follows:-
; ; setup the next-error stuff including grep and compiling ; set-variable $line-template "[0-9]+" set-variable $file-template "[a-zA-Z:]*[0-9a-zA-Z\_.]+" ; ; Definitions for GNU grep utility. ; set-variable %grep-com "grep -n " add-next-line "*grep*" "" add-next-line "*grep*" "%f:%l:"
grep(1), %grep-com(5), add-next-line(2), get-next-line(2), compile(3).
(c) Copyright JASSPA 1999
Last Modified: 1998/09/03
Generated On: 1999/12/01