If file exists count lines

Hello,

Currently I have:

FILE=/home/file.txt

if [ -f $FILE ];
then
   echo "File $FILE exists"
else
   echo "File $FILE does not exist"
fi
exit

I would like to make it such that if the file *does* exist, it performs a wc -l count of the file and then if the count is greater than 3 performs some command....how do I integrate the second if command to wc -l and alert if file has more than 3 lines?

Thanks and Happy New Year!

one way

FILE=/home/file.txt

if [ -f $FILE ];
then
   echo "File $FILE exists"
   cnt=$(cat $FILE  | wc -l)  # deliberate UUOC
   if [ $cnt -gt 3 ] ; 
   then
          echo "$FILE is larger than 3 lines"
   fi
else
   echo "File $FILE does not exist"
fi

Is this homework?

Just curious, but why?

--ahamed

ok guys, solved, thanks!