Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Mar 1998 08:03:02 +1030
From:      Greg Lehey <grog@lemis.com>
To:        Marty Leisner <leisner@sdsp.mc.xerox.com>, Johann Visagie <wjv@cityip.co.za>
Cc:        Jake <jake@int.checker.org>, freebsd-questions@FreeBSD.ORG
Subject:   Re: what does grep stand for?
Message-ID:  <19980302080302.64725@freebie.lemis.com>
In-Reply-To: <9803012048.AA15657@gnu.sdsp.mc.xerox.com>; from Marty Leisner on Sun, Mar 01, 1998 at 12:48:46PM -0800
References:  <E0y9ETs-0005Wl-00@ns.cityip.co.za> <9803012048.AA15657@gnu.sdsp.mc.xerox.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun,  1 March 1998 at 12:48:46 -0800, Marty Leisner wrote:
>
> In message <E0y9ETs-0005Wl-00@ns.cityip.co.za>,   you write:
>> Jake wrote:
>>>
>>> My teacher says grep stands for Get Regular ExPression,
>>> I thought it was more complicated.
>>
>> Global regular expression and print, I always thought.  In ed(1):
>>
>>  g/re/p
>
> Get a new teacher.

Why?

>> From the jargon file:
>
> :grep: /grep/ /vi./  [from the qed/ed editor idiom g/re/p,
>    where re stands for a regular expression, to Globally search
>    for the Regular Expression and Print the lines containing matches
>    to it, via {{Unix}} `grep(1)'] To rapidly scan a file or set
>    of files looking for a particular string or pattern (when browsing
>    through a large set of files, one may speak of `grepping
>    around').  By extension, to look for something by pattern.  "Grep
>    the bulletin board for the system backup schedule, would you?"
>    See also {vgrep}.

Where's the contradiction?  Originally, in ed(1), to search for, say,
lines ending in foo
(like the previous one), you'd enter

  g/foo$/p

It was rather inconvenient to start ed for this common function, so
they wrote grep instead.

Greg

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980302080302.64725>