From: bob@... (Bob Proulx) Date: 2007-09-07T12:22:13+09:00 Subject: Re: subject line M. Edward (Ed) Borasky wrote: > "grep" standing for "Generalized Regular Expression Processor", etc. Being the pedant that I am I have to clarify this statement. The 'grep' name came from use in 'ed' and similar editors. Of course ed-like editors were the standard editors at the time that grep was written. Why were line editors used? Because a screen editor just does not function well on the paper printing terminals commonly in use at that time. :-) A common operation by anyone who uses a line editor is to print lines matching a pattern in the file. The way to do this in 'ed' is the following: $ ed somefile g/RE/p q The 'q' quits the editor (in case you try this and need to know how to get out of the program). The /RE/ is a regular expression pattern. If the RE matches then invoke the command-list. The 'g' is a suffix to globally operate on every line in the file. Without the 'g' (global) suffix the command would operate only on the current line. The 'p' is the command-list item to print. Putting this all together the command reads, globally operate on every line of the file, if a line matches the regular expression then print it. Global Regular Expression Print. grep. Bob