Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions Subject: Re: RTFM... I wish... (Re: appolgies "obviously") Message-ID: <11427@bloom-beacon.MIT.EDU> Date: 14 May 89 19:06:23 GMT References: <1539@cmx.npac.syr.edu> <132@mcl.UUCP> <2859@buengc.BU.EDU> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Organization: Massachusetts Institute of Technology Lines: 20 In article <2859@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes: >In that vein, I've R'ed TMFM, and I've twiddled the permutations, but >I just can't seem to get sed(1) to print lines 110 through 115 of >a file. It seems the most basic of things, but sed(1) insists on >printing the whole file, no matter what I do... The key here is that sed(1) will always print its input lines to the standard output unless you tell it not to, so what you have to do is tell it to delete everything *except* for the lines you want to print. This should work: sed '110,115 !d' Of course, you'll have to quote the ! with a backslash if you use csh (and possibly ksh, although I'm not sure). Jonathan Kamens USnail: MIT Project Athena 410 Memorial Drive, No. 223F jik@Athena.MIT.EDU Cambridge, MA 02139-4318 Office: 617-253-4261 Home: 617-225-8218