Created
October 27, 2020 17:43
-
-
Save obedmhg/9d52e80f7b8613513f8e58e6019fa9e9 to your computer and use it in GitHub Desktop.
find_in_jar.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#serch all jar files | |
for jar in $(find -name \*.jar); do | |
files=$(unzip -l $jar | grep -i '*\.[xml|properties]' | awk '{print $4}'); | |
for file in $files; do | |
#check if the found file contains 'test.log' | |
if unzip -p $jar $file | grep -i 'test\.log'; then | |
#print the found jar and file name | |
echo " $jar $file "; | |
fi ; | |
done; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment