[ale] who is the fastest bash scripter?

Michael D. Hirsch mhirsch at nubridges.com
Mon Feb 24 14:40:17 EST 2003


On Monday 24 February 2003 02:33 pm, Michael D. Hirsch wrote:
> On Monday 24 February 2003 02:20 pm, Jason Vinson wrote:
> > I want to run a bash script that will do the following:
> >
> > jar -tf *.jar | grep <classname>
> >
> >
> > which will iterate through ./*.jar, and if it finds anything that
> > matches the classname, it will print the jar file name.
>
> you mean
>
> 	for i in *.jar; do jar -tf $i| grep <classname>; done
>
> ?

That will work, but you'll never know what jar it was in.  Heh.

Try this

#!/bin/bash
for i in *.jar; do
	jar -tf $i | grep <classname> &> /dev/null
	if [ $? -ne 0 ]; then
		print $i
	fi
done



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






More information about the Ale mailing list