I've been trying to write a one line which checks java processes and filter them for a user (testuser) and then check process arguments with PARGS command and then check if there is certain patterns exists in pargs output then kill the process.
I have tried the following so far, could you please help to complete the one liner? I also appreciate if you could verify what I'm doing is the right way to achive it or not.
comes with the pargs command output not directly with "ps -ef" output. so I need to apply pargs command to see arguments and if the arguments contains
/tomcat.*\/conf\/.*properties/
afterwards i can be sure that tomcat process ID is correct so can be killed..
I have checked again;
the following gives arguments of desired PID. I keep the PID in sprintf so that i will use it again as i have to call it again (in Kill -15). I could not complete after the following one, any help appreciated.