There is no solution which will stop cron from using
sh -c. It is the way cron works. When you post a crontab take note of the message you receive.
Ps: "I am using the Sun solaris OS"
This could be almost any version of a Berkeley Unix or Unix System V Operating System amongst the Sun (now Oracle) hybrids:
Solaris (operating system) - Wikipedia, the free encyclopedia
Use the
uname -a command and blot anything confidential like computer names with X's.
Interrogating "ps -ef" with "grep" is not the best way to determine if another instances are running (and it is unreliable). Use semaphore files.
In your context if you really want to use
ps, then
ps -fu<username> reduces the possibilities for mismatches (but sometimes
ps will still omit processes).
Ps. The simple answer to your question is to use
grep -v but you have rejected this for some reason.