Skip to content

Instantly share code, notes, and snippets.

@bsiegfreid
Created December 30, 2021 15:10
Show Gist options
  • Save bsiegfreid/551722f0ffdf7c39211fe95c25d3c94e to your computer and use it in GitHub Desktop.
Save bsiegfreid/551722f0ffdf7c39211fe95c25d3c94e to your computer and use it in GitHub Desktop.
Quick script to search for a class in a collection of jar files. Needs work.
#!/usr/bin/env bash
if ! shopt -q globstar; then
echo "Requires bash 4.0"
return 1 2>/dev/null || exit "1"
fi
# globstar requires bash 4.0
shopt -s globstar dotglob nullglob
for f in **/*.jar
do
echo $f
jar tvf $f | grep --color $1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment