Skip to content

Instantly share code, notes, and snippets.

@lrytz
Last active October 16, 2015 08:15
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 lrytz/b4309d6f4ce7ccaf4d37 to your computer and use it in GitHub Desktop.
Save lrytz/b4309d6f4ce7ccaf4d37 to your computer and use it in GitHub Desktop.
asm shell script
#!/bin/sh
files="$@"
asm_jar=~/Applications/bin/asm-5.0.2/lib/all/asm-all-5.0.2.jar
asm_main=org.objectweb.asm.util.Textifier
debug=""
for f in $files; do
if [[ $f == "-a" ]]; then
debug="-debug"
else
dirname=$(dirname "$f")
basename=$(basename "$f")
class=${basename%%.class}
java -cp $asm_jar $asm_main $debug $f > $dirname/$class.asm
fi
done
#!/bin/sh
files="$@"
asm_jar=~/Applications/bin/asm-5.0.2/lib/all/asm-all-5.0.2.jar
asm_main=org.objectweb.asm.util.CheckClassAdapter
if [[ $# != 2 ]]; then
echo "usage: asmver <classpath-colon-separated> <classfile>"
exit 1
fi
java -cp $asm_jar:$1 $asm_main $2 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment