The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 04-24-2009
julirani julirani is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 14
Unhappy

Quote:
Originally Posted by panyam View Post
Julirani,

I am not sure of the application process, but there is a possibility that there will be multiple instances of a.sh running , but the time u manually check it , the execution of script might be over.

Check in the remaining part of the script any infinite loops or conditions exist?..



HI Panyam,
Thanks for your reply . Actually , it is strange , when i doing the grep using the below command
command:
ps -ef | grep "/appl/a.sh" | grep -v "grep"
output :
user 20169 20168 0 06:00:13 ? /bin/ksh /appl/a.sh
user 20168 1 0 06:00:13 ? 0:00 sh -c /appl/a.sh


But when i print the value of the var for the below command it showing diffrent .

command:
PROCESS=`ps -ef | grep "/appl/a.sh" | grep -v "grep" | wc -l`
echo $PROCESS

output :
4


But the output always not the same .some thimes it showing the correct value i.e 2 .



So i am unable to find the root cause . Is it any problem with the OS ?
Could you please help me regarding this.


Thanks in advance .