Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.

Re: question for perl book & magazine authors

by tomazos (Deacon)
on Oct 19, 2005 at 21:48 UTC ( #501440=note: print w/replies, xml ) Need Help??

in reply to question for perl book & magazine authors

While we are talking about grep, does anyone know why grep is called grep? I would have thought filter would be a more appropriate name? Anyone know the "etymology" of the word grep?


  • Comment on Re: question for perl book & magazine authors

Replies are listed 'Best First'.
Re^2: question for perl book & magazine authors
by runrig (Abbot) on Oct 19, 2005 at 21:56 UTC
    It comes from the (Unix) grep utility which stands for (g)lobal-(r)egular (e)xpression-(p)rint.
Re^2: question for perl book & magazine authors
by chester (Hermit) on Oct 19, 2005 at 21:57 UTC
    In vim, the command :g/re/p (where g means "global", re is clearly "regex" and p means "print") will find all lines matching the regex and print them in a list. This was apparently true of vim's predecessors as well, but it's still a valid (and useful) command in vim today. See also Wikipedia.
      Says chester:
      In vim...
      The g/re/p command actually goes back to ed, which was the original Unix editor, back around 1972, and is still provided with all Unix systems. After ed came vi, the visual editor, with command syntax similar to ed's, and then vim, which is an improved version of vi.

      Early versions of Unix also had a gres command (perform a substitution on all matching lines) but it was obsoleted by sed and abandoned.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://501440]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2023-12-11 12:21 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (41 votes). Check out past polls.