Next: prune Procedure, Previous: which Procedure, Up: Utility Procedures
Search the file called filename (a fully specified path) for lines that contain a match for regular expression regexp. The result is a list of all the lines that match. If no lines match, the result is an empty string. Specify regexp using the standard regular expression style used by the Unix utility program grep.
Use the optional third argument line to start lines in the result
with the line number in filename. (This argument is simply an
option flag; type it just as shown --line
.)
grep{filename regexp –line}
filename
The file to search.
regexp
The Unix style regular expression (as used by the
grep
Unix utility) to search
for.
--line
Prefix the line number to each line where the regexp matches.