
How grep got its name - milesf
http://robots.thoughtbot.com/post/871533965/how-grep-got-its-name
======
judofyr
Wait, what? As a non-native speaker of English, I've always assumed that
"grep" is a normal English verb.

~~~
pg
That's very funny. It's actually starting to be now.

~~~
judofyr
I've always connected it with "grip" (and the Norwegian translation: "gripe").
/usr/bin/grep runs through STDIN and "grips" the matching lines, while
everything else flows through and disappear. That totally made sense in my
head…

EDIT:

 _In December 2003, the Oxford English Dictionary Online added draft entries
for "grep" as both a noun and a verb._ —
[http://en.wikipedia.org/wiki/Grep#Usage_as_a_conversational_...](http://en.wikipedia.org/wiki/Grep#Usage_as_a_conversational_verb)

~~~
ElbertF
I made similar connection, in Dutch the word "grijp" (which sounds a bit like
"grep") means "grab". I figured "grep" is to "grab" stuff from a file.

------
nuxi
From Early history of UNIX: "When asked what that funny name meant, Ken said
it was obvious. It stood for the editor command that it simulated, g/re/p
(global regular expression print)."

[http://massis.lcs.mit.edu/archives/history/early.history.of....](http://massis.lcs.mit.edu/archives/history/early.history.of.unix)

------
strlen
There goes my theory about grep, awk, sed being named after digestive noises.

What's interesting is the history of dd and its completely non-UNIX like
argument format e.g., if=/dev/null of=./foo bs=4k: the latter was designed as
a prank mocking IBM's mainframe OSes (today's equivalent would be making a
FactoryFactory in Python, I'd imagine)

~~~
epochwolf
grep = Global Regular Expression Print

awk = Administrator's Wisdom Kit

sed = Stream EDitor.

~~~
SwellJoe
66% correct:

awk = Aho, Weinberger, Kernighan

------
spicyj
Wow, I was thinking about this just this morning. I assumed it stood for "GNU
regular expression parser" or something like that, even though that doesn't
really make sense.

~~~
jff
Don't fall victim to RMS's propaganda--as another poster pointed out, grep,
ed, sed, awk, etc. all predate GNU's braindamaged implementations.

~~~
ithkuil
agreed on the RMS propaganda stuff.

But I'm sincerely interested to know why you say that their implementations
are braindamaged.

------
aristus
Extra credit: how did glob get its name? I've never found an explicit answer,
but the Unix 71 manual suggests that it's short for "global".

<http://cm.bell-labs.com/cm/cs/who/dmr/man71.pdf>

~~~
ori_b
Glob was already a word. Dictionary.com claims it dates back to about 1900,
and might come from the blending of "globe" and "blob"

------
duck
More about ed - <http://en.wikipedia.org/wiki/Ed_(text_editor)>

_It was one of the first end-user programs hosted on the system and has been
standard in Unix-based systems ever since. ed was originally written by Ken
Thompson and contains one of the first implementations of regular
expressions._ ... _Famous for its terseness, ed gives almost no visual
feedback. For example, the message that ed will produce in case of error, or
when it wants to make sure the user wishes to quit without saving, is "?". It
does not report the current filename or line number, or even display the
results of a change to the text, unless requested._

~~~
bluesmoon
One of the reasons ed is so terse is because bandwidth was really expensive
back when it was written. Not necessarily in terms of money (since everyone
was at a university), but in terms of time.

If your editor were to echo back everything you'd typed, you'd waste twice the
bandwidth (once to send a keystroke in and once to get it echoed back). Though
in reality it would be more like 4 times because each character sent through
would require a TCP-ACK packet sent back. By saying nothing, ed became really
fast.

sed took things to the next level. If you already had a file on a remote
system, and wanted to make changes to it, all you had to do was note down the
'ed' commands to make those changes, and then tell sed to run them. You didn't
have to open ed to operate on the file, you just had to send your commands
over the network and sed would operate on the file remotely. A more efficient
rsync, if you will.

~~~
mturmon
ed preceded TCP (first ed manual I could find is dated 1971; the first TCP
research paper was by Cerf and Kahn in 1974).

When ed was used, it would be common to interact with the computer on a
teletype, not even on a crt monitor. So a response meant printing characters
on paper.

sed was and is more about programmatic editing (i.e., editing a stream as it
was generated, using a script for commands), or editing of large files that
would overwhelm system memory, not about some kind of remote usage the way
you're describing.

------
bluesmoon
strange, I'd always thought that everyone already knew this. It's mentioned in
"Mastering Regular Expressions" and also in "Sed and Awk".

------
ralph
"ed was a command-line editor that worked identically to the colon-commands in
vi and vim—in fact, you can press Q to get into ed mode (then type vi to get
back into vim)."

This is wrong. Pressing Q in vi quits visual mode and returns you to ex(1).
ex(1) precedes vi(1) and was an extended editor, based on ed(1). That's why
the commands are similar, but not identical. And ed(1) isn't dead, it still is
a command-line editor. :-)

------
mahmud
OT: but those ThoughtBot people know how to make beautiful websites.

------
code_duck
That's interesting. I recall ed from the Amiga...

