reg no of instances of a script run using cron

I have the below code in a file called test.ksh and it is scheduled using cron forevery 5 min. when i see the cron out file for every 5 min it showing the no of process running are 2. same thing when i implement in another script which contains other code along with the below code , it showing as 1. why?
Both the scripts were scheduled using cron.

echo "Cron process testing "
echo `ps -ef |egrep 'test.ksh'|egrep -v grep`
a=`ps -ef |egrep 'test.ksh'|egrep -vc grep`
echo "No of process running :$a" :confused:

Make sure your quotes (")or(') should be used as recommended. Following piece of code might work

echo "Cron process testing"
echo "ps -e |egrep -c "test.ksh"
a=`ps -e |egrep -c "test.ksh"`
echo "No of process running :$a"