Jing:
The LET is optional, and you're using the wrong command substitution character. Use the grave mark ` not the quote ':
activejob=`ps -ef|grep -v 'grep test.sh'|grep 'test.sh'|wc -l `
I also included grep -v to ignore that command in the process table.
You can also use the ksh method of command substituition:
activejob=$(ps -ef|grep -v 'grep test.sh'|grep 'test.sh'|wc -l
Regards,
Ed