smritisingh03,
From a reader point of view your script is long and uses a lot of unknown files. It’s difficult to guess what it should do. I suppose you know that. But I don’t know.
Moreover your script is invalid. The function begins:
Code:
compareLOGandDBfunction()
{
but never ends.
I suggest you to put at the beginning of the script the following code:
Code:
started=$(date +"%s")
function works {
elapsed=$(expr $(date +"%s") - $started)
started=$(expr $started + $elapsed)
echo -e "\033[1m$elapsed sec.\033[0m"
echo
}
Then put
works command in selected places to track the time passed from the start of the script, for example:
Code:
.
.
.
done < $file2
works
.
.
.
The other method is to put at the beginning of the script the following code:
Code:
declare -i number=0
function number {
number=$number+1
echo
echo -e "\033[1m$number.\033[0m"
}
Then precede the commands you suspect work too slow with the sequence
number; time, for example:
Code:
.
.
.
number; time while read FILE1_LINE ; do
.
.
.