Return to Snippet

Revision: 11307
at January 31, 2009 12:04 by narkisr


Initial Code
# instead of running
$ jps 
18904 Main
18951 SpringMain
19055 Jps
$ btrace 18951 jdftm/ReflecTracer.class

# We issue (the traced application main class is SpringMain)
$ jps | awk '/SpringMain/{system("btrace " $1 " jdftm/ReflecTracer.class")}'

Initial URL


Initial Description
Running a btrace script takes two separate steps by default:
1. Running jps to get the Java process ID.
2. Running btrace on the ID.
A simple awk script can merge the two into a single step.

Initial Title
Runing btrace in a single command

Initial Tags
Bash, java

Initial Language
Java