Exit Status

I have a shell script (#!/bin/sh) that interacts with Appworx and Banner Admin. In my script I want to check the exit status of awrun before continuing. awrun can run for 10 seconds or it can run for over a minute. So my question is, will it go through my if statement before awrun may even be completed? Or will it wait to get an exit status before it goes through the if statement? If it just goes through before it has a exit status value, then how do we wait for it to return an exit status before continuing? Thanks in advance for all solutions regarding my issue.

 
awrun.....
OUT=$?
if [ $OUT -eq 0 ];then 
      echo "awrun ran successfully"
else 
      echo "awrun Failed"
fi

Why not sleep?

sleep 60

This will wait for 1 minute. here 60 denotes seconds.
Cheers,
Ranga:-)

As long as you do not run awrun in the background then the if statement should wait..

Alternatively you can do this:

if awrun....
then
  echo "awrun ran successfully"
else 
  echo "awrun Failed"
fi