Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site lsuc.UUCP Path: utzoo!utcs!mnetor!lsuc!msb From: msb@lsuc.UUCP (Mark Brader) Newsgroups: net.sources.bugs Subject: Re: YASS (yet another shell script) Message-ID: <1159@lsuc.UUCP> Date: Thu, 20-Mar-86 00:56:52 EST Article-I.D.: lsuc.1159 Posted: Thu Mar 20 00:56:52 1986 Date-Received: Thu, 20-Mar-86 09:22:55 EST References: <620@ssc-vax.UUCP> <153@sci.UUCP> <860@decuac.UUCP> <359@umcp-cs.UUCP> Reply-To: msb@lsuc.UUCP (Mark Brader) Distribution: net Organization: Law Society of Upper Canada, Toronto Lines: 19 Summary: sed Frederick M. Avolio: > >The problem with the awk versions is that they process the whole file, > >even after you are no longer interested in output. Chris Torek: > Not if you do it right: > alias line "awk 'NR == \!:1 { print; exit }' \!:2*" You people should read net.sources.d. Jan Gray posted this there days ago: sed -n -e $1p -e $1q $2 Not only is it faster than awk, it's short enough that you can just type it. Who needs an alias or script for a line that short? Oh, and besides THAT, it's more portable than the original. More people have sed than head. Mark Brader P.S. Most lines of the form: grep this | sed "s/that/the other/" can also be easily turned into single sed -n command.