printing messages on the screen when background process is going on!

hello all,

In my script i have written some messages which should come in screen while some background process is going on..

Like for example:

if i want to add 2 numbers a and b ...when the addition is going on in the background i should get "ADDING TWO NUMBERS>>PLEASE WAIT " message on the screen for few seconds...

what i did is...

used the below code in my script..but it is not printing anything on the screen. but still i'm getting proper output.

But if the messages comes in the screen then the script will look better so please help me..

print " *******************************************"
print " *********ADDING TWO NUMBERS*****************"
print " ********* PLEASE WAIT ...........*****************"
print " *******************************************"

Please post the script and state exactly how the script will be run and in what context (command line, command line with nohup ... &, cron etc. ).

Adding two numbers on a modern computer should take nanoseconds. Displaying the result on a terminal takes longer.

Perhaps I don't understand, but If you want the message to appear while the work is being done, why run it in the background? Just display your message, do the work, then clear the screen and continue with your script. You can use the "wait" command to make your script wait until the background work is done before it continues, but it defeats the purpose of running it in the background in the first place.

Yes may be it is taking less time to do the work so the print mesasge which is shown above is appearing in the screen...

So please tell me what I can do to the so that the above print message appears on the screen atleast 2-3 seconds..

and if i have use wait command then tell me where i can use the command? i mean before the above print message or after the print message?

---------- Post updated at 07:20 PM ---------- Previous update was at 07:02 PM ----------

Example for my above scenario,

num=`cat $REQ2 | grep DateTimeStamp | awk -F":" '{print $2}'`
pgrm=`cat $REQ2 | grep Program | awk -F":" '{print $2}'`
name=cat $REQ2 | grep Name | awk -F":" '{print $2}'`
mail=cat $REQ2 | grep email | awk -F":" '{print $2}'`
clear
    print " *********************************************************"
           print " * Extracting information................................*"
           print " * Make sure that the information provided is correct... *"
           print " * And then close the Request info review to continue... *" 
           print " *********************************************************"
clear
print                                 
   printf " Request Information review "
   print                                  
   print " Number                  : $num"
   print " Program                       : $Pgrm"
   print " Name              : $name"
   print " Email                 : $mail"

I want that print message thing to be appear on the screen for sometime before giving the request info review.. Please help

---------- Post updated at 07:57 PM ---------- Previous update was at 07:20 PM ----------


UPDATE:

Now my problem has been solved.. I have used sleep command to get it done..

MODERATORS PLEASE CLOSE THIS THREAD AS IT IS SOLVED

Thanks for all you guys