Created
November 14, 2012 11:26
-
-
Save yyuu/4071634 to your computer and use it in GitHub Desktop.
display digests of all class files in jar
This file contains hidden or 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/sh | |
| abspath() { | |
| ( cd $(dirname $1) && echo "$(pwd)/$(basename $1)" ) | |
| } | |
| for _jar in "$@"; do | |
| jar=$(abspath $_jar) | |
| tmpdir=$(mktemp -d) | |
| cd "${tmpdir}" && { | |
| jar xf "${jar}" | |
| find . -type f -and -name '*.class' -print0 | xargs -0 --no-run-if-empty sha1sum -- | sort -k2 | |
| } | |
| rm -rf "${tmpdir}" | |
| done | |
| # vim:set ft=sh : |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment