#!/bin/sh USAGE="usage: runcacaf what infile mach dir test" #VERS="version: ${USHutil}/runcacaf 2000-03-17 07:15L" #in production ${USHutil}=/nwprod/util/ush/ # #___________________________________________________________________________ # NAME : runcacaf # Author : Peter Henrichsen # Purpose : This scrip is started by DBNET via a Foreign alert that # : was started from one of cpc's workstations. # : This script makes a script job to start script # : cacafos.sh. The cacafos.sh script creates 2 afos maps. # : 6ka and 6kb from the "infile". The "infile" was created on the # : sgi work station and then moved to the ncosp via ftp. # : After the afos products are created they will be converted # : into awips format. Finally both types of maps will be sent to # : world. # : # History : 1999-07-01 Peter Henrichsen # : 1999-12-15 Peter Henrichsen modified to use USHutil # : 2000-03-17 Peter Henrichsen modified so that # dbnet can run the script. # # Location : This script is found on hp36 as: # : /tmp_mnt/export/sgi73/peterhen/util/scripts/ibm/runcacaf # : & on ncosp as # : /nwprod/util/ush/runcacaf or # : /nfsuser/g02/wx12ph/util/ush/runcacaf # # Argumemts: 'what' this is the name of the script to run. # : 'infile' is the input data card file (fullpath). # : 'mach' is the name of the workstation where data card # : file was created. # : The 4th & 5th args are optional "dir" & "test" are used in # : testing. # : Arg 4 is the test base dir for the fix, ush, sorc & exec. # ie /nfsuser/g02/wx12ph or /nwtest. # : Arg5 is used to send in test mode if it is "send". #_____________________________________________________________________________ integer istat set -x export PATH=${PATH}:. # export child script name. export NAME="$1" export pilist='6ka 6kb' export PIL='6ka6kb' export MEMBER=fn$NAME #___________________________________________________________________________ # get varables to exportation to child scripts $MEMBER . #___________________________________________________________________________ export INFILE="$2" export MACH="$3" export USR="$3" export whatdir=$NAME if test $# -ge 4 then envir=test export homedir="$4" export HOMEutil=$homedir comout=$HOMEutil/com/foreign/$envir export HOMEout=/tmpuser/$LOGNAME pcom=$HOMEutil/pcom/foreign if test $# -eq 5 then what="$5" if test "$what" = 'send' then envir=prod SENDCOM=YES SENDDBN=YES else envir=test SENDCOM=NO SENDDBN=NO fi fi else envir=prod SENDCOM=YES SENDDBN=YES who=$LOGNAME if test "$who" = 'dbnprd' then export HOMEout=/tmpnwprd/dbnprd else export HOMEout=/tmpuser/dbnprd fi export HOMEutil=/nwprod comout=/com/foreign/$envir pcom=/pcom/foreign fi # # ######################################## # Set up this job's temporary directory to # store processing files. # ######################################## export DATA=$HOMEout/$whatdir.$$ mkdir -m 775 -p $DATA >/dev/null 2>&1 export FIXutil=$HOMEutil/util/fix export EXECutil=$HOMEutil/util/exec export USHutil=$HOMEutil/util/ush export utilities=$HOMEutil/util/ush export envir SENDCOM SENDDBN mkdir -m 775 -p $pcom >/dev/null 2>&1 mkdir -m 775 -p $comout >/dev/null 2>&1 cd $DATA echo " set the CYCLE" CYCLE=t00z cycle=$CYCLE export CYCLE cycle # run setup to initialize working directory and utility scripts export utilexec=/nwprod/util/exec export utilscript=/nwprod/util/ush # Run setup to initialize working directory and utility scripts sh $utilscript/setup.sh # Run setpdy and initialize PDY variables sh $utilscript/setpdy.sh . ./PDY job=FN$MACH jlogfile=/com/logs/snd2forgn_log export pid=$$ export reqid=${$} export pgmout=$job.$NAME.$pid jobid="${job}.o${reqid}" model=man export output=output.$job.$NAME.${PIL}.$pid export comout envir jlogfile jobid model pcom job # _______________________________________________________________________ # start the $MEMBER # _______________________________________________________________________ $USHutil/$MEMBER>>$DATA/$pgmout 1>>$DATA/$pgmout 2>>$DATA/$pgmout cd rm -rf $DATA exit