To reduce execution time

Hi All,

The below script I run daily and it consumes 2 hours approx.
In this I am calling another script and executing the same twice.
Is the loop below the cause for the slow process?Is it possible to finetune the program so that it runs in a much faster way?

The first script:

#!/bin/ksh

for file in 1 2
do
echo "Started on `date`" | tee -a secondscript.log
secondscript.sh   2>&1| tee -a secondscript.log
echo "Ended on `date`" | tee -a secondscript.log
done

Second script contains hundreds of compilation statements(Those are error free).

Nothing wrong with your loop.
It will be what you are doing in the 'secondscript.sh'.
Being that you are executing hundreds of compilation statements, then it might be reasonable that it takes a while.
Are you able to post the contents of the 'secondscript.sh' ??

Cheers,
Cameron

p.s. - Need to drop or qualify "$dayext" in your script too.

Thanks Cameron for your clarification.

Removed duplicate post

Removed duplicate post