YASS (yet another shell script)
Mark Brader
msb at lsuc.UUCP
Thu Mar 20 15:56:52 AEST 1986
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.
More information about the Comp.sources.bugs
mailing list