Computing.Net > Forums > Unix > how to properly use - ps -ef ???

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

how to properly use - ps -ef ???

Reply to Message Icon

Name: ihsail
Date: January 18, 2006 at 09:14:20 Pacific
OS: Solaris
CPU/Ram: 2GH
Comment:

Please help...

I found the following command at ask.com and it seems useful to find whether a script is currently executing.

However, I have no clue how to use it properly (I've tried). I want to use the command to find the string of the script name that I am looking for, if the string is found then that means it is running and I want to EXIT, otherwise, continue with the next step.

Please shed some light of how to properly use the below command for the above situation.

Thanks much...


if ps -ef | grep "_script1_" | grep -v grep >/dev/null
then
exit
else
process part 2
if

ihsail



Sponsored Link
Ads by Google

Response Number 1
Name: Dlonra
Date: January 18, 2006 at 13:10:26 Pacific
Reply:

does
ps -ef | grep "_script1_" | grep -v grep

display the script?


0
Reply to Message Icon

Related Posts

See More


SSH and DF -H from differ... Unix shell script



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: how to properly use - ps -ef ???

how to get a process name ? www.computing.net/answers/unix/how-to-get-a-process-name-/3945.html

How to create background deamon on www.computing.net/answers/unix/how-to-create-background-deamon-on-/4716.html

How to kill idel user www.computing.net/answers/unix/how-to-kill-idel-user/4678.html