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