Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!uwm.edu!ux1.cso.uiuc.edu!news.iastate.edu!sharkey!wyn386!wybbs!sleepy From: sleepy@wybbs.mi.org (Mike Faber) Newsgroups: comp.unix.shell Subject: Re: does a zgrep exist? (zgrep <> zcat | grep) Message-ID: <348@wybbs.mi.org> Date: 19 Feb 91 15:13:14 GMT References: <1991Feb15.232854.13378@robobar.co.uk> <463@bria> <1991Feb18.075330.15536@convex.com> <12845:Feb1900:14:4891@kramden.acf.nyu.ed Reply-To: sleepy@wybbs.UUCP (Mike Faber) Organization: Consultants Connection, Jenison MI Lines: 26 a simple shell invoked with arguements is easy enough... $ sh zgrep string file [file ...] zgrep: if [ $# -lt 2] then echo usage: exit 1 fi vgrep=$1 shift while [ $# -gt 0 ] do zcat $i | grep $vgrep | awk fil=$1 '{printf("%s:%s\n",fil,$0)}' shift done Now, was that so painful... -- sleepy@wybbs.UUCP Michael Faber