I tried this program with using for loop...
=========================================
set -x
f()
{
enccp -c mas start serv_nm -v -myPwd encina_admin
}
i=0
for i in 1 2
do
f &
x=`jobs -p`
{ sleep 1; kill -9 $x; } &>/dev/null &
wait $x
date
i=`expr $i + 1`
done
===========================================
OUTPUT:
-------------
[/home2/niroj_p]./fun
+ i=0
+ + f
+ enccp -c mas start serv_nm -v -myPwd passwd
+ jobs -p
x=0
+ sleep 1
+ 1> /dev/null
+ wait 0
+ date
Wed Sep 10 13:57:24 IST 2008
+ + expr 1 + 1
i=2
+ f
+ + enccp -c mas start serv_nm -v -myPwd passwd
+ + jobs -p
x=0
0
0
+ sleep 1
+ 1> /dev/null
+ wait 0 0 0
+ date
Wed Sep 10 13:57:24 IST 2008
+ + expr 2 + 1
i=3
[/home2/niroj_p]starting serv_nm
retrieving attributes of object serv_nm ... done
setting up the server resources
retrieving node object mars6 ... done
creating file system path /var/opt/encina/local/subsys/encina/css6/server/serv_nm ... exists
retrieving encina server group name ... done
retrieving encina administration organization ... done
starting serv_nm
retrieving attributes of object serv_nm ... done
setting up the server resources
retrieving node object mars6 ... done
creating file system path /var/opt/encina/local/subsys/encina/css6/server/serv_nm... exists
retrieving encina server group name ... done
retrieving encina administration organization ... done
+ kill -9 0
# Kill is working nice
=====================
After this I have to enter any key to come out from the process.
That I want to avoid..
Thank u friends...