Shell Script - Getting an argument from ps result
I am writing a shell script, and want to get a specific argument from 'ps -ef' results. The order of arguments is different and awk (with column no) gives different values.
ps -ef | grep process
returns multiple processes with more than 50/60 unordered arguments each, but each process has a unique argument e.g. -Dwas.servername=WP_1
How can I 'ps -ef' so that I get values for -Dwas.servername for each process like below?
Even the output like below will also be handy:
Thanks in advance,