Launch JConsole auto connect

jconsole `ps aux | awk '/[a]ctivemq-5.8/ {print $2}'`

For the layperson that doesn't speak geek, full explanation of the syntax below:

` ` back-quotes delineate commands which are evaluated first so the result(s) are passed instead
ps aux lists all running processes in user friendly format, pid in second column
| pipes the output of the previous command to the input of the following command
awk parses the ps output - don't need grep - SO
' ' single-quotes delineate instructions to awk
/ / foreslashes delineate a regex evaluation in awk
[a] sneaky use of regex to eliminate regex returning both activemq and awk pid from ps output - SO
{ } braces delineate awk actions
print $2 prints the 2nd column of the ps output

Comments

Popular posts from this blog

Sites, Newsletters, and Blogs

Oracle JDBC ReadTimeout QueryTimeout