Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Grep
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==History== Before it was named, grep was a private utility written by [[Ken Thompson]] to search files for certain patterns. [[Doug McIlroy]], unaware of its existence, asked Thompson to write such a program. Responding that he would think about such a utility overnight, Thompson actually corrected bugs and made improvements for about an hour on his own program called "s" (short for "search"). The next day he presented the program to McIlroy, who said it was exactly what he wanted. Thompson's account may explain the belief that grep was written overnight.<ref>{{cite AV media|url=https://www.youtube.com/watch?v=EY6q5dv_B-o |archive-url=https://ghostarchive.org/varchive/youtube/20211211/EY6q5dv_B-o| archive-date=2021-12-11 |url-status=live|title=VCF East 2019 -- Brian Kernighan interviews Ken Thompson|publication-date=6 May 2019|publisher=YouTube|type=video}}{{cbignore}} (35 mins)</ref> Thompson wrote the first version in [[PDP-11]] [[assembly language]] to help [[Lee E. McMahon]] analyze the text of ''[[The Federalist Papers]]'' to determine authorship of the individual papers.<ref>Computerphile, ''[https://www.youtube.com/watch?v=NTfOnGZUZDk Where GREP Came From]'', interview with [[Brian Kernighan]]</ref> The [[ed (text editor)|ed text editor]] (also authored by Thompson) had [[regular expression]] support but could not be used to search through such a large amount of text, as it loaded the entire file into memory to enable [[random access]] editing, so Thompson excerpted that regexp code into a standalone tool which would instead process arbitrarily long files sequentially without buffering too much into memory.<ref name=history102 /> He chose the name because in ed, the command <code>g/re/p</code> would print all lines featuring a specified pattern match.<ref>{{cite web|url=http://perl.plover.com/classes/HoldSpace/samples/slide012.html|title=ed regexes|website=perl.plover.com|access-date=24 April 2018|url-status=dead|archive-url=https://web.archive.org/web/20171020031534/https://perl.plover.com/classes/HoldSpace/samples/slide012.html|archive-date=20 October 2017}}</ref><ref>{{cite web|url=http://robots.thoughtbot.com/how-grep-got-its-name|title=How Grep Got its Name|website=robots.thoughtbot.com|access-date=24 April 2018|url-status=dead|archive-url=https://web.archive.org/web/20170809155158/https://robots.thoughtbot.com/how-grep-got-its-name|archive-date=9 August 2017}}</ref> grep was first included in [[Version 4 Unix]]. Stating that it is "generally cited as ''the'' prototypical software tool", McIlroy credited grep with "irrevocably ingraining" Thompson's [[tools philosophy]] in Unix.<ref name="reader">{{cite tech report |first1=M. D. |last1=McIlroy |author-link1=Doug McIlroy |year=1987 |url=http://www.cs.dartmouth.edu/~doug/reader.pdf |title=A Research Unix reader: annotated excerpts from the Programmer's Manual, 1971β1986 |series=CSTR |number=139 |institution=Bell Labs |url-status=live |archive-url=https://web.archive.org/web/20171111151817/http://www.cs.dartmouth.edu/~doug/reader.pdf |archive-date=2017-11-11 }}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Grep
(section)
Add topic