Brutally simple shell script I often use to find a class file that I know exists somewhere in a directory tree full of jar files (but generally useful for finding files somewhere in a directory tree of zips):
#!/bin/bash for zip in $* do echo $zip for file in $(unzip -Z -1 $zip) do echo "$zip:$file" done doneI put this in a file called zipdump, then do things like this:
find -name "*.jar" | xargs zipdump | grep SomeClassAnd get:
./some/random/path/foo.jar:com/google/whatever/SomeClass.class
I love the shell. This is excellent stuff!
ReplyDeleteOh, thanks for the great call-it hack here :D But I was trying to use it following your instructions and then an issue appered: my shell just refused to identify java file content as it supposed to! But I was trying to fix this with the tool that I'm usually using to fix the corrupted file association on my laptop, assuming that it will hep me to open .jar file https://wikiext.com/jar And it worked, yay!) But yet, did anybody faced the same problem here after using this script?
ReplyDelete