Hi,
I have a shell script that does 2 things.
Section1 calls an oracle procedure which creates a txt file and signal file (sig).
Section2 checks to ensure the files are created, then moves them to another directory.
My question:
Is it possible for section2 to begin processing before section1 is finished processing? If so, how can i get my script to wait and allow section1 to comlpete?
<the code is below>
#section1:
echo $PASSWORD | sqlplus -s sales@db1 @${SQL_DIR}/sales1.sql >>$LOG_FILE 2>&1
#section2:
SIG_FILES=$( ls -t file1_*.sig )
DAT_FILES=$( ls -t file1_*.txt )
if (( $( print ${SIG_FILES} | wc -w ) != $( print ${DAT_FILES} | wc -w ) )) then
#
# Consistency error # of sig files is not
# the same as # of txt files
#
print "ERROR: Consistency error in ${DIR1} directory ..." >>$LOG_FILE 2>&1
mailx -s "SALES EXPORT Script Error" -c $CC $TO < $LOG_FILE
exit 1
fi
I have a shell script that does 2 things.
Section1 calls an oracle procedure which creates a txt file and signal file (sig).
Section2 checks to ensure the files are created, then moves them to another directory.
My question:
Is it possible for section2 to begin processing before section1 is finished processing? If so, how can i get my script to wait and allow section1 to comlpete?
<the code is below>
#section1:
echo $PASSWORD | sqlplus -s sales@db1 @${SQL_DIR}/sales1.sql >>$LOG_FILE 2>&1
#section2:
SIG_FILES=$( ls -t file1_*.sig )
DAT_FILES=$( ls -t file1_*.txt )
if (( $( print ${SIG_FILES} | wc -w ) != $( print ${DAT_FILES} | wc -w ) )) then
#
# Consistency error # of sig files is not
# the same as # of txt files
#
print "ERROR: Consistency error in ${DIR1} directory ..." >>$LOG_FILE 2>&1
mailx -s "SALES EXPORT Script Error" -c $CC $TO < $LOG_FILE
exit 1
fi