In shell script in centos, i write following 2 lines
cmdread="Myprogram"
kill -9 `ps ax | grep $cmdread `
But some times when manually myprogram stopped then my shell script give me warning that nothing to kill. So how to check like following
if(by grep myprogram's pid != null){
kill it
}