Hi,
I need to run a cron job that will check if a process is running. In the shell script that will be invoked, I am thinking of doing a ps -ef | grep "process name" and based on the output, do the processing.
Is this the best way to do it? If it is, I have another doubt. If I do the ps statement, I will get 2 lines - 1 for the process and one more for the grep statement. How can I eliminate the grep component from my output?
Regards,
Baashha
I need to run a cron job that will check if a process is running. In the shell script that will be invoked, I am thinking of doing a ps -ef | grep "process name" and based on the output, do the processing.
Is this the best way to do it? If it is, I have another doubt. If I do the ps statement, I will get 2 lines - 1 for the process and one more for the grep statement. How can I eliminate the grep component from my output?
Regards,
Baashha