Skip to content

Instantly share code, notes, and snippets.

@nielsvanderbeke
Created March 24, 2014 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nielsvanderbeke/9735847 to your computer and use it in GitHub Desktop.
Save nielsvanderbeke/9735847 to your computer and use it in GitHub Desktop.
search in jar file
pattern="smtp"
for jar in /usr/share/java/*.jar; do
for file in $(unzip -l $jar | perl -nle 'split /\s+/ and print $_[-1];'); do
unzip -c $jar $file | grep -qi "$pattern" && (
rpm -qf $jar 2>&1 >/dev/null && \
rpm -qf $jar || \
echo "orphan jar: $jar"
);
done
done | sort -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment