Not clear what you want to achieve. You say bip.sh runs in background but you want it to run in foreground? In your code snippet I can't see bip.sh in background; you run it in FG until it finishes, then wait 6 min (for what?), and then run runXitInvoice_PROFORMA_integ on the last two lines of the log file. Please explain in detail and with samples what you want.
Hi Rudi ,
Thanks for the reply..bip.sh is designed to run in background .It is parameterized
script. It takes an account number as an input.For every account number it generates an unique number which needs to passed to another script and execution time of each bip.sh $accoun_num is different.
So how can i make sure that runXitInvoice_PROFORMA_integ begins execution only after bip.sh $accoun_num is finished its execution.
currently i am using sleep 100 but it is not efficient.
Improve the bip.sh!
Remove & signs, so commands run in foreground.
In case the delays are caused by /dev/random, consider replacing it with /dev/urandom (faster but randomness is lower).
Hi german boy,
Can't change the bip.sh.It is a very critical script which generate the bill.client would not allow me to change it .
So i am looking for workaround.
Thanks.
#!/bin/sh
ARBOR_DB_PASSWD=`cat $ARBORDIR/.arborpw`; export ARBOR_DB_PASSWD
DB_PASS=$ARBOR_DB_PASSWD; export DB_PASS;
ORACLE_SID=$ARBOR_CATALOG_DATABASE; export ORACLE_SID;
ARBORCTRLRPT03=$ARBORDATA/reports/ctrl; export ARBORCTRLRPT03;
Usage(){
echo "\n\n Usage is: `basename $0` <proc_num> <bip mode> <account_no>\n"
echo " where <proc_num> is a number between 01 and 99"
echo " <bip_mode> is a number. Use 0=production, 3=proforma, 6=backout"
echo " <bip_mode> is an arbor accout number\n\n"
exit 0
}
# Check number of arguments
if [ "$#" -ne 3 ] ; then
Usage
fi
# Check to see if ARBORDBU is set
if [ -z "${ARBORDBU}" ] ; then
echo "ERROR: \$ARBORDBU environment variable is not set\n"
echo "This script requires that the \$ARBORDBU environment variable be set.\n\n"
exit 1
fi
# Check to see if DB_PASS is set
if [ -z "${DB_PASS}" ] ; then
echo "ERROR: \$DB_PASS environment variable is not set\n"
echo "This script requires that the \$DB_PASS environment variable be set.\n\n"
exit 1
fi
# Check to see if ORACLE_SID is set
if [ -z "${ORACLE_SID}" ] ; then
echo "ERROR: \$ORACLE_SID environment variable is not set\n"
echo "This script requires that the \$ORACLE_SID environment variable be set.\n\n"
exit 1
fi
# Set the variables for arguments passed by the user
PROCNAME=bip$1
BIP_MODE=$2
ACCOUNT=$3
# Get the database from the user's environment
DB=$ORACLE_SID
# Set this so that the process doesn't try to connect to Operations Center
OAM_ENV_CONN_MA=FALSE
export OAM_ENV_CONN_MA
# Log into sqlplus, delete any existing entries, and make the new entry
sqlplus -s $ARBORDBU/$DB_PASS@$DB <<END
update SYSTEM_PARAMETERS set int_value=1 where module='BIP' and parameter_name='TRA_SWITCH';
delete from PROCESS_SCHED where process_name = '$PROCNAME';
delete from PROCESS_STATUS where process_name = '$PROCNAME';
insert into PROCESS_SCHED values('$PROCNAME','$PROCNAME','N',$BIP_MODE,SYSDATE,86400,0,2,55,'$DB','CMF.account_no in ($ACCOUNT)',1,NULL,0,NULL,0);
commit;
exit
END
echo "Starting BIP in the background with process name = \"$PROCNAME\""
BIP $PROCNAME 3 &