parsing script

Hello everybody!
I'm trying to create a parse script but I keep getting errors. Can you please help me out.

#!/bin/bash
#Blank Blank
#April 6, 2011
##########################################################################################
#Script from Google.com
#Modified by blank blank
#Modified on April 6, 2011
##########################################################################################
#This Script is to file parse the log files while implementing a timing script
##########################################################################################
##########################################################################################
#set -x #Uncomment to debug this script
#set -n #Uncomment to check script syntax without any execution,
##########################################################################################
##########################################################################################
#
#From Randy K. Micheal
#
function hello
{
echo "source?"
read A
echo "destination?"
read B
INFILE= $A #/home/blank/Desktop/script/access_log* 
OUTFILE= $B #writefile.out

}

########################################################################################

function rotate
{
while [[ cat_while_read_LINE ]];     # Loop forever...until this function is killed
do
    (( RCOUNT = RCOUNT + 1 )) # Increment the RCOUNT

    case $RCOUNT in
    1) echo "."
       sleep 1s
       ;;
    2) echo ".."
       sleep 1s
       ;;
    3) echo "..."
       sleep 1s
       ;;
    4) echo "...c"
       sleep 1s
       ;;
    5) echo "...co"
       sleep 1s
       ;;
    6) echo "...cof"
       sleep 1s
       ;;
    7) echo "...coff"
       sleep 1s
       ;;
    8) echo "...coffe"
       sleep 1s
       ;;
    9) echo "...coffee"
       sleep 1s
       ;;
    10) echo "...coffeeB"
       sleep 1s
       ;;
    11) echo "...coffeeBr"
       sleep 1s
       ;;
    12) echo "...coffeeBre"
       sleep 1s
       ;;
    13) echo "...coffeeBrea"
       sleep 1s
       ;;
    14) echo "...coffeeBreak"
       sleep 1s
       ;;
    15) echo "...coffeeBreak."
       sleep 1s
       ;;
    16) echo "...coffeeBreak.."
       sleep 1s
       ;;
    17) echo "...coffeeBreak..."
       sleep 1s
       ;;
    *) RCOUNT="0" # Reset the RCOUNT to "0", zero.
       ;;
    esac
done
}

########################################################################################
#
#From Randy K. Micheal
#
function cat_while_read_LINE
{
#Method 1

#Zero out the $OUTFILE

>$OUTFILE

cat $INFILE | while read LINE
do
    echo "$LINE" >> $OUTFILE
    :
done
}

########################################################################################
#
# From Randy K. Micheal
#
#
#QFILE=access_log.*
#{
#cat $QFILE | while read LINE
#do
#    echo "$LINE" >> $OUTFILE
#    :
#done
#}

########################################################################################

#Time and parse the file
hello
echo "parsing"
rotate 
ROTATE_PID=$!
X=$(date +%s)
cat_while_read_LINE &
Y=$(date +%s)
kill $ROTATE_PID
DIF=$(( $Y - $X ))
MIN=$(( $DIF / 60 ))
SEC=$(( $DIF % 60 ))
if [ $DIF -ge 60 ]
then
    echo "The file(s) were parsed in $MIN minute(s) and $SEC seconds!\n";
else
    echo "The file(s) were parsed in $DIF second(s)! \n";
fi

These are the errors that I keep on getting

/home/blank/Desktop/script/access_log-20101201: line 870: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 871: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 872: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 873: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 874: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 875: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 876: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 877: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 878: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 879: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 880: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 881: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 882: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 883: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 884: 209.221.168.11: command not found
/home/blank/Desktop/script/access_log-20101201: line 885: 66.249.65.70: command not found
/home/blank/Desktop/script/access_log-20101201: line 886: 123.125.66.124: command not found
/home/blank/Desktop/script/access_log-20101201: line 887: 207.46.13.86: command not found
/home/blank/Desktop/script/access_log-20101201: line 888: 220.181.7.130: command not found
/home/blank/Desktop/script/access_log-20101201: line 889: 129.121.131.74: command not found
/home/blank/Desktop/script/access_log-20101201: line 890: 129.121.131.74: command not found
/home/blank/Desktop/script/access_log-20101201: line 891: 208.115.111.248: command not found
/home/blank/Desktop/script/access_log-20101201: line 892: 208.115.111.248: command not found

I guess that the problem is due to the [[ ]] in the rotate function.
You need cat_while_read_LINE to return true (0) for the while loop to continue and false (non 0) for the while loop to terminate. No square brackets are needed.

Can you show me an example of how to implement this return true(0)

---------- Post updated at 09:17 AM ---------- Previous update was at 09:15 AM ----------

Can you show me an example of how to implement the return true(0)