While loop is not working file.. It also invokes one more shell scripts for which parameters need to passed on.
while read line
do
####
#### We want to have a logfile for each load
####
PLog="${LogDir}/${Script}.log";
####
#### Need to keep creating DDL one after another
####
echo "${line}" >> ${ProFILE}
${line} >> ${PLog}
done < ${INPUT_FILE}
Then maybe build in a counter ie. a variable that is set in the start to 1 and at the end of the loop (still inside) is incremented by 1, using the shell's arithmetic functions or let or expr. Use this variable in the filename when redirecting output so you have different names for each load counting up.
ksh invoke.ksh <parameter1> <parameter2>
The ksh is not needed in front of the line. Remove it and use a sheband which means 1st line in your script has to be
#!/usr/bin/ksh
<parameter1> will be $1 inside your script and <parameter2> will be $2. So when calling the second shell script, just pass those 2 positional shell parameters to the script when calling it like:
Main script
Script=`basename $0`
IDWADMINMAIL="xxx@xx.com.au";
WDIR=/home/refresh
LogDir=${WDIR}/log
INPUT_FILE=${WDIR}/all.ksh
ProFILE=${WDIR}/process.log
cd ${WDIR}
while read line
do
####
#### We want to have a logfile for each load
####
PLog="${LogDir}/${Script}.log";
####
#### Need to keep creating DDL one after another
####
echo "${line}" >> ${ProFILE}
${line} >> ${PLog}
done < ${INPUT_FILE}
mailx -s "COMPLETED - DDL Transfer at `date '+%Y%m%d.%H%M'`" ${IDWADMINMAIL} << !!EOT
I see none of the suggestions I made built into your script and you also ignored my bid to use code tags which you also got as PM with explanation how to use them.
What did you not understand what I wrote?
Since you seem to ignore code tag requests and PMs and also give no answer to the suggestions for your problem made, you are collecting infraction points this way. When you have collected 30, you will be banned from the forum. I am not sure if this is your goal but I do not want to deprive this information.