Hi All,
I am new to unix , Please help me regarding the below issue . my application's main pragram in "a.sh" and one upstream application sending a file daily via connect direct and then calling the script "a.sh" . But the condition in our apll. is no two thread can't run at a time. so there is a validation in "a.sh" but some times it showing the error "one thread running" but when i checked with ps-ef command..then it not satisfying the below condition .
Below is the code :
Code:
PROCESS=`ps -ef | grep "/appl/a.sh" | grep -v "grep" | wc -l`
if [ $PROCESS -gt 2 ]
then
echo " ERROR:- One thread is running "
exit 1
fi