Look into this and suggest if any changes needed

Hi,
I am new script programming, I have written a script shown velow to read username and passwd from /etc/security/passwd, i am able to read username, but unable to grep lastupdate. please look into the code and suggest if any changes need.

#!/bin/ksh

USERNAME=""
fname=/usr/bin/lastupdate
ftemp=./temp

cat /etc/security/passwd | \
while read LINE
do
echo "$LINE" > fstring
USERWORDCNT=`grep ":" fstring | wc -w`
if [ $USERWORDCNT = 1 ]
then
USERNAME=$LINE
fi
UPDATEWORDCNT=`grep "lastupdate" fstring | wc -w`
if [ $UPDATEWORDCNT = 1 ]
then
UPDATE=`cat fstring | cut -d= -f2`
echo "$UPDATE"
STRING=$USERNAME$UPDATE
echo $STRING >> $fname
USERNAME=""
UPDATE=""
fi
done
chmod 666 $fname

Note: The output of programme should write username and lastupdate values ony to another new file in this format as shown below:

smith:12445
grith:34455

Helo.
You've been asking the same thing repeatedly. Have a look at the forum rules (#4).
Besides, I gave you some tips for what you are asking:
http://www.unix.com/showthread.php?t=28659
Have you read/tested them? I'm afraid you have not...

Regards.