[ale] who is the fastest bash scripter?

Michael D. Hirsch mhirsch at nubridges.com
Wed Feb 26 12:11:10 EST 2003


On Wednesday 26 February 2003 11:34 am, Geoffrey wrote:
> Jason Day wrote:
> > On Tue, Feb 25, 2003 at 08:05:00PM -0500, David S. Jackson wrote:
> >>How about just using zgrep instead of calling tar or gunzip or
> >> whatever?
> >>
> >>zgrep -H <classname> *.jar
> >
> > Unfortunately, that won't work.  The 'z' commands (zgrep, zcat, zless,
> > zmore, ...) only uncompress files that were compressed with zlib,
> > which is what gzip uses.  Jar files use PKZip compression, an entirely
> > different scheme.
> >
> > On the other hand, grep <classname> *.jar works.
>
> Okay, I've forgotten the original purpose of the excersize, but someone
> correct if I'm wrong.  If all you're trying to do is locate the jar file
> a classfile is contained in, what's wrong with:
>
> jar -tf foo.jar classname.class
>
> If there's a number of jar files then:
>
> for jf in *.jar;do
>
> jar -tf $jf classname.class > /dev/null && print $jf
> done
>
> Or, was the intent to search the actual source code for a classname
> contained within???

That's the exact solution several people came up with.  It was pointed out 
that jar is very slow and it is faster to use tar.

Michael
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list