Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!romp!auschs!cello!reed!d75!awdprime!nostromo.austin.ibm.com!daveb From: daveb@nostromo.austin.ibm.com (Dave Burton) Newsgroups: comp.unix.questions Subject: Re: First-line-only editing, part 2: Portable solutions Summary: last time. really. Message-ID: <4152@awdprime.UUCP> Date: 8 Nov 90 17:42:47 GMT References: <16471:Oct2420:13:4390@kramden.acf.nyu.edu> <4031@awdprime.UUCP> <687@npdiss1.StPaul.NCR.COM> Sender: news@awdprime.UUCP Reply-To: daveb@bach.austin.ibm.com (Dave Burton) Organization: IBM AWD, Austin, TX Lines: 22 In article <16471:Oct2420:13:4390@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: |As shown in my previous message, sed is much slower than a head-sed-cat |combination on a particular 300K file. ... | So the fastest portable solution I've seen is | head -1 file | sed 's/.../.../'; tail +2 file In article <4031@awdprime.UUCP> daveb@bach.austin.ibm.com (Dave Burton) writes: |[ no, try: ] |sed 's/.../.../;1q' < file > outfile which, of course, doesn't output the entire file. Therefore, it seems that the "fastest portable solution" [we've] seen is: sed 's/.../.../;1q' file; tail +2 file or (sed 's/.../.../;1q'; tail +2) < file Now, truly, nuff said. :-) -- Dave Burton inet: daveb@bach.austin.ibm.com uucp: cs.utexas.edu!ibmchs!auschs!nostromo!daveb