Filesize not working

I am having problems with finding the filesize with this in my script:

filesize=`ls -l | awk '$5=0'`

if [ -d $1 ]; then
   ls -l | awk '{print $9 " " $5}'
   if [ $filesize ]; then
      echo "Would you like to delete this file? (y/n)"
         if yes do this
         elif no do this
         fi
   fi
else
   echo "error"
fi

It does display the things I want, name and size. But it stops there, not even an error message. The awk '$5=0' means if filesize is 0.
Can anyone help me out on this please?

Use $5 == 0 instead

I think you are trying to find files with size 0, and then asking Y/N to delete them.
Instead of all that script try this:

# just remove zero-length files, not directories

find /path/to/files -type f  -size 0 -ok rm {} \;

When i replace
filesize=`ls -l | awk '$5=0'`
with
FILESIZE="ls -l | awk $5 == 0"
I get an error this time. line 28: [: too many arguments
line 28 is the if [ $FILESIZE ]

Because the default print action in awk is to print the entire record...as you are interested only in the file size modify the action to print only the 5th col.

FILESIZE=$(ls -l | awk '$5 == 0 {print $5}')

try this
rm -i `ls -lrt|awk '$5==0{print $9}'`

Although the 'rm -i' command from vidyadhar85 does work. I want it to display the directory contents one-by-one than ask me to delete.
I changed the 'FILESIZE=' to the new one posted by shamrock but it goes through the current directory first than the directory I listed on the command line, command is ./file-info mytestdir
It's supposed to go through the optional directory not both. What's going on?

when you run the script it will go through the current directly only because child process it creates an inherited environment..
try running script . ./filename.sh arguments