Mail Archives: djgpp/1996/10/14/21:13:55
Caltoi wrote:
>
> I'm a self taught tinkerer in programming and I keep seeing a program
> called grep. What is it and what does it do??
>
> please reply via email
> --
> Caltoi
> rowe AT epix DOT net
> http://www.epix.net/~rowe
grep = Get Regular ExPression...its used for finding patterns of
information in file/s. Here is a portion of our man page on grep:
(Note: This is for Unix, but gives you a good idea... :)
NAME
grep - search a file for a pattern
DESCRIPTION
The grep command searches files for a pattern and prints
all lines that contain that pattern. It uses a compact
non-deterministic algorithm.
Be careful using the characters $, *, [, ^, |, (, ),
and \ in the search because they are also meaningful
to the shell. It is safest to enclose the entire
pattern list in single quotes '...'.
If no files are specified, grep assumes standard input.
Normally, each line found is copied to standard output. The
file name is printed before each line found if there is more
than one input file.
/usr/xpg4/bin/grep
The options -E and -F affect the way grep interprets
pattern list. If - E is specified, grep interprets
pattern_list as a full regular expression (see - E for
description). If - F is specified, grep interprets
pattern_list as a fixed string. If neither are specified,
grep interprets pattern list as a basic regular expression
as described on regex(5) manual page.
Leathal.
- Raw text -