How to know a executable has finished his task

Hi frnds,

I want to know is there a way by which we can know that a C++ executable has finished its job in shell script.

My task is as follows:

1.Shell script calls a executable

2.Executable executes and performs its job of generating some reports.

Now i want my shell script to detect this that is C++ executable has completed its job so that shell script can send the reports as attachement.

Please help me urgently on this

Perform a simple

ps -aef |grep [process name] |grep -v grep

If it doesn't return any data, process is finished.

What is the difference between this and http://www.unix.com/shell-programming-scripting/48213-how-check-succeesfull-finish-executable-sheel-script.html?

Wat this done means

Duplicate thread. That is against the rules. Use How to check succeesfull finish of a executable from the sheel script