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

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!mcsun!sunic!ericom!eos.ericsson.se!etxmesa
  3. From: etxmesa@eos.ericsson.se (Michael Salmon)
  4. Subject: Re: How do I get a particualr line of a file?
  5. Message-ID: <1992Nov23.094227.1677@ericsson.se>
  6. Sender: news@ericsson.se
  7. Nntp-Posting-Host: eos6c02.ericsson.se
  8. Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
  9. Organization: Ericsson Telecom AB
  10. References:  <pec2.722467852@Isis.MsState.Edu>
  11. Date: Mon, 23 Nov 1992 09:42:27 GMT
  12. Lines: 25
  13.  
  14. In article <pec2.722467852@Isis.MsState.Edu>, 
  15. pec2@ra.msstate.edu (Paul E. Carroll) writes:
  16. |> This seems extremely simple, but I've run into the problem several times
  17. |> and gotten stumped each time.  So how do I view a particualr line of a 
  18. |> file?  Head looks at the top, tail the end, cat - echo - more - or less-
  19. |> look at the whole thing... but what if I want to see just line 30?
  20. |> or JUST line 210?  I'm stumped.
  21.  
  22. This works for me:
  23.  
  24.  eos6c02 tmp 98 > cat -n /usr/etc/termcap | tail +210l | head -1
  25.    210          :md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
  26.  
  27. The cat -n is just to insert line numbers of course.
  28.  
  29. -- 
  30.  
  31. Michael Salmon
  32.  
  33. #include    <standard.disclaimer>
  34. #include    <witty.saying>
  35. #include    <fancy.pseudo.graphics>
  36.  
  37. Ericsson Telecom AB
  38. Stockholm
  39.