home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / question / 13812 < prev    next >
Encoding:
Text File  |  1992-11-22  |  1.1 KB  |  30 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!caen!nic.umass.edu!news.amherst.edu!twpierce
  3. From: twpierce@unix.amherst.edu (Tim Pierce)
  4. Subject: Re: How do I get a particualr line of a file?
  5. Message-ID: <By5Dt2.4Ls@unix.amherst.edu>
  6. Organization: Elitist Usenet Administrators, Stuff & Nonsense Division
  7. References: <pec2.722467852@Isis.MsState.Edu> <1992Nov22.235943.13501@umbc3.umbc.edu> <1epbqtINNskk@violet.csv.warwick.ac.uk>
  8. Date: Mon, 23 Nov 1992 02:34:13 GMT
  9. Lines: 19
  10.  
  11. In article <1epbqtINNskk@violet.csv.warwick.ac.uk> maupb@csv.warwick.ac.uk (Mr J L Saunders) writes:
  12.  
  13. >In article <1992Nov22.235943.13501@umbc3.umbc.edu> rouben@math9.math.umbc.edu (Rouben Rostamian) writes:
  14. >
  15. >%To print line 30:
  16. >%sed -n 30p filename
  17. >
  18. >Even simpler, for csh or tcsh, do
  19. >alias line "sed -n \!:1p \!:2"
  20. >
  21. >Then type line 7 filename, or line 30,35 filename, for example.
  22.  
  23. Unless my knowledge of sed fails me here -- which is entirely possible
  24. -- you'll waste fewer machine cycles with sed -n '30p;30q' filename.
  25.  
  26. -- 
  27. ____ Tim Pierce                / 
  28. \  / twpierce@unix.amherst.edu /               Rocks say goodbye.
  29.  \/ (BITnet: TWPIERCE@AMHERST) / 
  30.