06-16-2006
3,
0
Join Date: Jun 2006
Last Activity: 22 June 2006, 6:48 AM EDT
Posts: 3
Thanks Given: 0
Thanked 0 Times in 0 Posts
ps -ef
Hi
In a script we are checking if any other instance of the same script is running to make sure that we don't run multiple threads, and if there is only one then we are proceeding otherwise coming out of it ..
To do this we check as below,
ps -ef | grep -i 'scriptname' | grep -v grep | wc -l
this at times returns 2, but when I try to display
ps -ef | grep -i 'scriptname' | grep -v grep
it shows only the current instance that is getting started ..
Can anyone please help me in figuring out the problem.
Many thanks