On Fri, May 24, 2002 at 12:06:22AM +0100, Justin (Home Office) wrote:
> Hi I'm looking for a quick bash script to get a list of all the *.jar
> files that have the file SAXParser.class in them
>> find /c -name '*.jar' -exec unzip -l '{}' \; | grep 'SAXParser.class' >
> /c/results.txt
I'm not a guru, but this is working for me:
find . -name \*.jar -exec bash -c "unzip -l {} \*SAXParser.class > /dev/null && echo {}" \; > /c/results.txt
You need the * in '*SAXParser.class' to match directories in the path,
but this suffers from the same bug as your's, i.e. it will match
foo.SAXParser.class.
> This nearly does it, but I really want '{}' (ie the jar filename)
> Any bash gurus have an idea?
>> Its on cygwin on windows, but its still bash...
>> Thanks J
>>> --
> Irish Linux Users' Group: ilug at linux.ie>http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
> List maintainer: listmaster at linux.ie
--
John
"That would preempt a bunch of problems involved in trying to reconstruct
exactly how the Perl 5 parser thinks, which nobody entirely understands."
Larry Wall, 2001/04/20, perl6-language at perl.org
"Finger to spiritual emptiness underlying everything." -- How a Japanese C
manual referred to a "pointer to void".
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!