home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / question / 13719 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  1.5 KB

  1. Xref: sparky comp.unix.questions:13719 comp.unix.misc:4279
  2. Newsgroups: comp.unix.questions,comp.unix.misc
  3. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!cs.ucf.edu!crigler
  4. From: crigler@cs.ucf.edu (James Crigler)
  5. Subject: Re: UNIX TRIVIA QUESTIONS!!
  6. Message-ID: <crigler.722320993@eola.cs.ucf.edu>
  7. Sender: news@cs.ucf.edu (News system)
  8. Organization: University of Central Florida
  9. References: <1992Nov20.144705.44987@kuhub.cc.ukans.edu>
  10. Date: Sat, 21 Nov 1992 04:43:13 GMT
  11. Lines: 34
  12.  
  13. yvonne@kuhub.cc.ukans.edu writes:
  14.  
  15.  
  16. >The following questions have come up in an operating systems
  17. >class I am taking.  As yet, we haven't discovered the answers.
  18. >Any help that you can offer would be appreciated!!
  19.  
  20. >UNIX TRIVIA(L) QUESTIONS
  21.  
  22. >1.  What is the origin of the command "grep"?  The command verb doesn't
  23. >    seem to bear any resemblance to its purpose.
  24.  
  25. [Stuff I can't answer deleted.]
  26.  
  27. In the editor "ed", if you want to display all lines that contain a particular
  28. "regular expression" (re), you would enter this command:
  29.  
  30.   g/regular expression/p
  31.  
  32. where
  33.     "g" means "global", 
  34.     "/regular expression/" is the thing you want to see the occurrences of
  35.     "p" means "print".
  36.  
  37. Now mentally abbreviate "/regular expression/" as "re" and voila!, grep.
  38.  
  39. I do know that it happened, but I can imagine the original grep as a shell
  40. script that created an ed editing script, then invoked it.  (It might
  41. be pretty easy.)
  42.  
  43. Jim Crigler
  44. crigler@eola.cs.ucf.edu
  45. ----------------------------
  46. Guinan is Q's mother.
  47.