I have a script written in Korn that hangs. Please see code below and advise. TIA

login as: dgrin
dgrin@cbdp57009's password:
Last unsuccessful login: Sat Jun 13 13:06:21 CDT 2009 on ssh from dbtrsqc1.chris                                                                                                 topherandbanks.com
Last login: Tue Jun 16 21:46:51 CDT 2009 on /dev/pts/0 from dbtrsqc1.christopher                                                                                                 andbanks.com
*******************************************************************************
*                                                                             *
*                                                                             *
*  Welcome to AIX Version 5.3!                                                *
*                                                                             *
*                                                                             *
*  Please see the README file in /usr/lpp/bos for information pertinent to    *
*  this release of the AIX Operating System.                                  *
*                                                                             *
*                                                                             *
*******************************************************************************
.profile[6]: ./retek/retaillogin.ksh:  not found.
----- Executing Environment setup script - /retek/retaillogin.ksh -----

Setting RPAS Env (RPAS_HOME/PATH) by running /retek/rpas/rpaslogin.ksh
Setting Tools Env (RIDE_HOME/JAVA_HOME/PATH) by running /retek/tools/toolslogin.                                                                                                 ksh
Setting JDBC Env (JDBC_HOME/OPENRDA_INI/CLASSPATH/PATH) by running /retek/rpas/j                                                                                                 dbcclient/jdbclogin.ksh

Setting startrpas/stoprpas aliases in the shell

Environment setup results (empty results should be addressed):
* RPAS_HOME (rpas) = /retek/rpas
* RIDE_HOME (tools) = /retek/tools
* JAVA_HOME (tools) = /usr/java14/jre
* JDBC_HOME (jdbc) = /vol.nas/u00/builds/devel/rpas/12.1.2/aix_opt/jdbcclient
* OPENRDA_INI (jdbc) = /retek/rpas/odbc/openrda.ini
* CLASSPATH (jdbc) = /vol.nas/u00/builds/devel/rpas/12.1.2/aix_opt/jdbcclient/jd                                                                                                 bc:/vol.nas/u00/builds/devel/rpas/12.1.2/aix_opt/jdbcclient/jdbc/oadriver.jar
* PATH (all) = /vol.nas/u00/builds/devel/rpas/12.1.2/aix_opt/jdbcclient/bin:/usr                                                                                                 /java14/jre/bin:/retek/tools/lib:/retek/tools/bin:/retek/rpas/bin:/usr/bin:/etc:                                                                                                 /usr/sbin:/usr/ucb:/home/dgrin/bin:/usr/bin/X11:/sbin:.

Shell alias setup results (these are not scripts, just shortcuts):
startrpas='DomainDaemon -port 3000 -start &'
stoprpas='DomainDaemon -port 3000 -stop'

----- Environment setup script Finished -----
Setting up Retek domain homes, in and out directories, binary home and batch hom                                                                                                 e
$ sudo su - rpasown
Password:
[YOU HAVE NEW MAIL]
----- Executing Environment setup script - /retek/retaillogin.ksh -----

Setting RPAS Env (RPAS_HOME/PATH) by running /retek/rpas/rpaslogin.ksh
Setting Tools Env (RIDE_HOME/JAVA_HOME/PATH) by running /retek/tools/toolslogin.                                                                                                 ksh
Setting JDBC Env (JDBC_HOME/OPENRDA_INI/CLASSPATH/PATH) by running /retek/rpas/j                                                                                                 dbcclient/jdbclogin.ksh

Setting startrpas/stoprpas aliases in the shell

Environment setup results (empty results should be addressed):
* RPAS_HOME (rpas) = /retek/rpas
* RIDE_HOME (tools) = /retek/tools
* JAVA_HOME (tools) = /usr/java14/jre
* JDBC_HOME (jdbc) = /vol.nas/u00/builds/devel/rpas/12.1.2/aix_opt/jdbcclient
* OPENRDA_INI (jdbc) = /retek/rpas/odbc/openrda.ini
* CLASSPATH (jdbc) = /vol.nas/u00/builds/devel/rpas/12.1.2/aix_opt/jdbcclient/jd                                                                                                 bc:/vol.nas/u00/builds/devel/rpas/12.1.2/aix_opt/jdbcclient/jdbc/oadriver.jar
* PATH (all) = /vol.nas/u00/builds/devel/rpas/12.1.2/aix_opt/jdbcclient/bin:/usr                                                                                                 /java14/jre/bin:/retek/tools/lib:/retek/tools/bin:/retek/rpas/bin:/usr/bin:/etc:                                                                                                 /usr/sbin:/usr/ucb:/home/rpasown/bin:/usr/bin/X11:/sbin:/stage/apps/bin:.

Shell alias setup results (these are not scripts, just shortcuts):
startrpas='DomainDaemon -port 3000 -start &'
stoprpas='DomainDaemon -port 3000 -stop'

----- Environment setup script Finished -----
Set up Retek domain homes, in and out directories, binary home and bat hom
e
Set up Retek domain homes, in and out directories, binary home and bat hom
e
/home/rpasown> cd $GM_DOM
/retek/rpas/domains/gm/TPGA> cd scripts
/retek/rpas/domains/gm/TPGA/scripts> ls
Daemon.log                    cb_mgr_costadj.sh
Daemon.log.old                cb_mgr_costadj_v1.sh
actualizeCp.sh                cb_mgr_shrinkr_v1.sh
backup                        cb_prg_reload_hier.sh
cb_commit_wb.sh               cb_profile.env
cb_div_actcp.sh               cb_profile_env.sh
cb_div_costadj.sh             cb_purge_wb.sh
cb_div_costadj_v1.sh          cb_purge_wblist.sh
cb_div_findalerts.sh          cb_reshapearrays.sh
cb_div_gm_cleanup.sh          cb_run_autowbbuild.sh
cb_div_gm_cleanup_v1.sh       cb_run_autowbbuild.sh_bak
cb_div_gmmeas_1.sh_old        cb_run_autowbbuild_new.sh
cb_div_invadj.sh              cb_search_replace.sh
cb_div_invadj_cleanup_v1.sh   cb_str_loadhier.sh
cb_div_invadj_v1.sh           cb_str_loadmeas.sh
cb_div_loadmeas_1.sh          cb_str_onorder.sh
cb_div_loadmeas_v1.sh         cb_str_purge_wb.sh
cb_div_onorder.sh             cb_str_runfrcst.sh
cb_div_purge_wb.sh            chown.sh
cb_div_purge_wblist.sh        createAlertsCost.sh
cb_div_receipt.sh             createAlertsRetail.sh
cb_div_runfrcst.sh            daemon3000.err
cb_div_stockledge.sh          daemon3000.log
cb_gm_dw_meas.sh              div_load_batch.sh
cb_gm_dw_meas.sh_bak          div_load_batch_purge.sh
cb_gm_dw_meas_extract.sh      div_load_batch_v1.sh
cb_gm_dw_meas_extract.sh_bak  div_meas_purge.sh
cb_gm_freight.sh              dstart3000.ksh
cb_gm_gmmeas.sh               dstop3000.ksh
cb_gm_gmmeas_1.sh             err
cb_gm_loadhier.sh             findAlertsCost.sh
cb_gm_loadmeas.sh             findAlertsRetail.sh
cb_gm_loadmeas_act.sh         kip_load_batch.sh
cb_gm_loadmeas_act_1.sh       loadLagMap.sh
cb_gm_loadmeas_conv.sh        loadmeas.sh
cb_gm_loadmeas_conv_1.sh      nohup.out
cb_gm_runbatch.sh             regFcstFunction.sh
cb_gm_shrink.sh               runFcst.sh
cb_mfp_div_pwp_ext.sh         runFcstChannel.sh
cb_mfp_div_pwp_load.ksh       str_load_batch.sh
cb_mfp_div_pwp_load_1.sh      tmp
cb_mfp_div_pwp_trans.sh       xferSLdata.sh
/retek/rpas/domains/gm/TPGA/scripts> vi dstart3000.ksh
"dstart3000.ksh" 45 lines, 1322 characters
#/bin/ksh
# set -x
###################################################################
#
# SCRIPT: dstart3000.sh
# Bring up the Domain
# AUTHOR: Narasimha Manga
#
# Description:
# Start the Domain Daemon Server Process on Port 3000
# Execution Syntax:
# ./dstart3000.ksh
# Revision History:
#   2007_09_21  Narasimha Manga  Script created
###################################################################
# Setting up variables
FATAL=255
SUCCESS=0
MAIL_SUBJECT="Domain Daemon Server Process failed to Start"
MAIL_TO="rpas@christopherandbanks.com"

program_name=`basename $0 .ksh`
start_time=`date +%y-%m-%d`

#Intializing log file and putting job start time
LOG_FILE="${GM_LOG}/${program_name}.${start_time}.log"
echo "Program ${program_name} started at ${start_time}" > ${LOG_FILE}
echo "Start DomainDaemon process at `date +%Y%m%d_%H%M%S`" >> ${LOG_FILE}

DomainDaemon -port 3000 -start > daemon3000.log 2> daemon3000.err

 if [ $? -ne 0 ]; then
    # The Domain Daemon Start failed ??
    echo ERROR - the Domain Daemon Start Server Failed >> ${LOG_FILE}
    mail -s "${MAIL_SUBJECT}" "${MAIL_TO}" < ${LOG_FILE}
    exit 1
   else
    echo Domain Daemon Started succesfully
 fi

echo  finish Domain Daemon Server Started Succesfully `date +%Y%m%d_%H%M%S` >> ${LOG_FILE}

# Save logfile
# Cleanup and close
#
~
~
~
~
~
~
"dstart3000.ksh" 45 lines, 1322 characters

Dude can u please reframe ur Doubt
Tracing this big code is quite timeconsuming

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.