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