Skip to content

Instantly share code, notes, and snippets.

@lrytz
Last active Oct 16, 2015
Embed
What would you like to do?
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