grep(1)

NAME
GREP -- search for text in multiple files

DESCRIPTION

This macro is used to overcome the usual problems of grep displaying more than a screen full of output, and forgetting to use 'more' or 'pg' to capture the output. In addition the grep macro allows the user to visit each file which contains the pattern selected.

The grep macro takes two arguments -- the string to search for and the files to look at. If these aren't specified then they are prompted for. The grep macro issues a standard Unix grep command and displays the output in a popup window.

Whilst grep is operating it prints the message:
    Locating text...

The user can move around this buffer with the usual cursor movement keys. The current entry is highlited. Pressing <Enter> on any particular line will cause the grep macro to edit the file in which that line occurs and go directly to the line selected.

The grep macro also re-maps the <Ctrl-N> and <Ctrl-P> keys. Pressing <Ctrl-N> will take you to the next file/line in the output from grep. <Ctrl-P> takes you to the previous line. Thus, repeated use of <Ctrl-N> allows the user to easily see the context (lines around the matching pattern) within each file.

The grep macro also supports a 'Change-Mode'. In this mode, the user can modify the lines in the grep pop up window, eg to make global substitutions, and by hitting the <Esc> key, all the changes can be made to the different files in one go. This is useful for example, in order to make a change to a variable name across all source files.

MENU/KEYS
This macro can be accessed from the CRISP features menu or by typing grep at the command prompt, with or without the required arguments.